FreeBSD Bugzilla – Attachment 243323 Details for
Bug 265736
F_SETFL will fail yet still set O_NONBLOCK for character devices that don't implement d_ioctl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Standalone test case
f_setfl_o_nonblock.c (text/plain), 559 bytes, created by
Alan Somers
on 2023-07-09 20:23:02 UTC
(
hide
)
Description:
Standalone test case
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2023-07-09 20:23:02 UTC
Size:
559 bytes
patch
obsolete
>#include <err.h> >#include <fcntl.h> >#include <stdio.h> > >int main(int argc, char **argv) { > int orig_flags, new_flags, fd, r; > char *devname = argv[1]; > > fd = open(devname, O_RDONLY); > if (fd < 0) > err(1, "open"); > > orig_flags = fcntl(fd, F_GETFL); > > r = fcntl(fd, F_SETFL, O_RDONLY | O_NONBLOCK); > > new_flags = fcntl(fd, F_GETFL); > > if (r < 0) { > printf("F_SETFL failed. Flags changed from %#x to %#x.\n", > orig_flags, new_flags); > } else { > printf("F_SETFL succeeded. Flags changed from %#x to %#x.\n", > orig_flags, new_flags); > } > > return (0); >}
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 265736
:
235799
|
243323
|
243325