FreeBSD Bugzilla – Attachment 156144 Details for
Bug 199806
[libc] Add a new option letter "l" to make fopen() use O_SHLOCK or O_EXLOCK when calling open()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch to add the proposed new option letter to fopen()
fopen_options_lock.patch (text/plain), 675 bytes, created by
jau
on 2015-04-30 11:25:53 UTC
(
hide
)
Description:
A patch to add the proposed new option letter to fopen()
Filename:
MIME Type:
Creator:
jau
Created:
2015-04-30 11:25:53 UTC
Size:
675 bytes
patch
obsolete
>Index: lib/libc/stdio/flags.c >=================================================================== >--- lib/libc/stdio/flags.c (revision 282268) >+++ lib/libc/stdio/flags.c (working copy) >@@ -52,6 +52,7 @@ > __sflags(const char *mode, int *optr) > { > int ret, m, o, known; >+ int do_locks = 0; > > switch (*mode++) { > >@@ -97,6 +98,10 @@ > /* set close-on-exec */ > o |= O_CLOEXEC; > break; >+ case 'l': >+ /* shared or exclusive locking */ >+ do_locks = 1; >+ break; > case 'v': > /* verify */ > o |= O_VERIFY; >@@ -112,6 +117,10 @@ > return (0); > } > >+ if (do_locks != 0) { >+ o |= (m == O_RDONLY) ? O_SHLOCK : O_EXLOCK; >+ } >+ > *optr = m | o; > return (ret); > }
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199806
: 156144