Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 161205 Details for
Bug 252000
flock demotion from exclusive to shared is incorrect
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
test program to do continous exclusive flock requests
flockwritelock.c (text/x-csrc), 1.05 KB, created by
Abhijith Das
on 2007-08-13 18:58:36 UTC
(
hide
)
Description:
test program to do continous exclusive flock requests
Filename:
MIME Type:
Creator:
Abhijith Das
Created:
2007-08-13 18:58:36 UTC
Size:
1.05 KB
patch
obsolete
>#include <stdio.h> >#include <unistd.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <sys/file.h> >#include <string.h> >#include <time.h> >#include <errno.h> > >int writelock(char *filename) >{ > int fd; > > if ((fd=open(filename,O_CREAT|O_RDWR,S_IRUSR|S_IWUSR|S_IRGRP))==-1) > { > fprintf (stderr,"Could not open %s:",filename); > perror (""); > exit(1); > } > >/* >** F_SETLKW seems to work on GFS under light load >** looping over F_SETLK will fail with errno operation not permitted >*/ > > int flock(int fd, int operation); > > while (flock(fd,LOCK_EX) == -1) > { > if (errno!=EAGAIN) > { > fprintf (stderr,"Could not get write lock on %s errno=%d:",filename,errno); > perror (""); > exit(1); > } > printf ("%s locked, trying again\n",filename); > } > > printf ("Have write lock, hit return to free write lock on %s and exit\n",filename); > fgetc(stdin); > > if (flock(fd,LOCK_UN) == -1) > { > fprintf (stderr,"Could unlock %s:",filename); > perror (""); > exit(1); > } > > close(fd); >} > >main(int argc, char *argv[]) >{ > int fd; > int i; > fd=writelock(argv[1]); >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 252000
:
161204
| 161205 |
161405
|
161406