bin/chio/chio.c
146
if ((changer_fd = open(changer_name, O_RDWR, 0600)) == -1)
bin/cpdup/hcproto.c
684
if ((flags & (O_WRONLY | O_RDWR)) == 0 && hc->version >= 4) {
bin/cpdup/hcproto.c
762
if (flags & (O_WRONLY | O_RDWR | O_CREAT | O_TRUNC)) {
bin/dd/dd.c
158
out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE);
bin/notty/notty.c
76
ttyfd = open("/dev/null", O_RDWR);
bin/notty/notty.c
88
fd = open("/dev/tty", O_RDWR);
bin/pax/ar_io.c
62
#define APP_MODE O_RDWR /* mode for append */
bin/pax/tty_subs.c
68
if ((ttyfd = open(DEVTTY, O_RDWR)) >= 0) {
bin/sh/jobs.c
188
if ((ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC_MAYBE)) < 0) {
bin/sh/redir.c
195
if ((f = open(fname, O_RDWR|O_CREAT, 0666)) < 0)
crypto/openssh/loginrec.c
1551
if (!lastlog_openseek(li, &fd, O_RDWR|O_CREAT))
crypto/openssh/loginrec.c
873
if (tty > 0 && (fd = open(UTMP_FILE, O_RDWR|O_CREAT, 0644)) >= 0) {
crypto/openssh/misc.c
1451
fd = open(name, O_RDWR);
crypto/openssh/misc.c
1456
if ((fd = open(name, O_RDWR)) >= 0)
crypto/openssh/misc.c
1514
if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
crypto/openssh/misc.c
2709
if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1) {
crypto/openssh/misc.c
2826
if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1) {
crypto/openssh/readpass.c
155
ttyfd = open(_PATH_TTY, O_RDWR);
crypto/openssh/sftp-server.c
261
flags = O_RDWR;
crypto/openssh/ssh-keysign.c
192
if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2)
crypto/openssh/sshd.c
1350
if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1)
crypto/openssh/sshpty.c
106
fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
crypto/openssh/sshpty.c
119
fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
crypto/openssh/sshpty.c
134
fd = open(tty, O_RDWR);
crypto/openssh/sshpty.c
227
if ((fd = open(_PATH_TTY, O_RDWR | O_NOCTTY)) >= 0) {
games/atc/log.c
109
score_fd = open(_PATH_SCORE, O_CREAT|O_RDWR, 0664);
games/backgammon/common_source/save.c
86
if ((fdesc = open(fname, O_RDWR)) == -1 && errno == ENOENT) {
games/canfield/canfield/canfield.c
1738
dbfd = open(_PATH_SCORE, O_RDWR);
games/hack/hack.main.c
565
if ((fd = open(RECORD, O_RDWR)) < 0) {
games/larn/io.c
552
if ((io_outfd = open(str, O_RDWR)) < 0) {
games/robots/score.c
70
if ((inf = open(Scorefile, O_RDWR)) < 0) {
games/snake/snake/snake.c
135
rawscores = open(_PATH_RAWSCORES, O_RDWR|O_CREAT, 0664);
games/tetris/scores.c
101
mint = O_RDWR | O_CREAT;
initrd/oinit/oinit.c
90
if ((fd = open(name, O_RDWR)) == -1) {
lib/libc/db/btree/bt_open.c
191
case O_RDWR:
lib/libc/db/btree/bt_open.c
202
if ((flags & O_ACCMODE) != O_RDWR)
lib/libc/db/db/db.c
57
O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC | O_CLOEXEC)
lib/libc/db/hash/hash.c
185
hashp->save_file = file && (hashp->flags & O_RDWR);
lib/libc/db/recno/rec_open.c
136
case O_RDWR:
lib/libc/db/recno/rec_open.c
81
O_RDWR, S_IRUSR | S_IWUSR, &btopeninfo, dflags);
lib/libc/db/recno/rec_open.c
83
dbp = __bt_open(NULL, O_RDWR, S_IRUSR | S_IWUSR, NULL, dflags);
lib/libc/db/test/btree.tests/main.c
165
db = dbopen(*argv == NULL ? NULL : *argv, O_RDWR,
lib/libc/db/test/btree.tests/main.c
168
db = dbopen(*argv == NULL ? NULL : *argv, O_CREAT|O_RDWR,
lib/libc/db/test/dbtest.c
89
oflags = O_CREAT | O_RDWR;
lib/libc/db/test/hash.tests/driver2.c
72
if (!(db = dbopen("bigtest", O_RDWR | O_CREAT, 0644, DB_HASH, &info))) {
lib/libc/db/test/hash.tests/tcreat3.c
65
O_CREAT|O_TRUNC|O_RDWR, 0600, DB_HASH, &ctl))){
lib/libc/db/test/hash.tests/tdel.c
67
if (!(dbp = dbopen( NULL, O_CREAT|O_RDWR, 0400, DB_HASH, &ctl))) {
lib/libc/db/test/hash.tests/thash4.c
69
if (!(dbp = dbopen( NULL, O_CREAT|O_RDWR, 0400, DB_HASH, &ctl))) {
lib/libc/gen/daemon.c
80
if (!noclose && (fd = _open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
lib/libc/gen/getpwent.c
1558
(*db = dbopen(NULL, O_RDWR, 600, DB_HASH, 0)) == NULL)
lib/libc/gen/readpassphrase.c
70
input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC);
lib/libc/gen/utmpx.c
494
db = dbopen(fname, O_RDWR|O_CREAT|O_EXLOCK|O_CLOEXEC, 0644, DB_HASH, NULL);
lib/libc/stdio/fdopen.c
59
if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) {
lib/libc/stdio/flags.c
99
m = O_RDWR;
lib/libc/stdio/fmemopen.c
165
if ((oflags & O_RDWR) == 0 && buf == NULL)
lib/libc/stdio/freopen.c
90
if ((dflags & O_ACCMODE) != O_RDWR && (dflags & O_ACCMODE) !=
lib/libc/stdio/mktemp.c
168
if ((*doopen = _open(path, O_CREAT|O_EXCL|O_RDWR|oflags,
lib/libc/upmap/upmap.c
154
fd = _open("/dev/upmap", O_RDWR);
lib/libc/upmap/upmap.c
225
fd = _open("/dev/lpmap", O_RDWR);
lib/libcam/camlib.c
339
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
lib/libcam/camlib.c
477
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
lib/libcuse/cuse_lib.c
113
f_cuse = open("/dev/cuse", O_RDWR);
lib/libdm/dm_task.c
237
if ((fd = open("/dev/mapper/control", O_RDWR)) < -1)
lib/libefivar/efivar.c
116
efi_fd = open("/dev/efi", O_RDWR);
lib/libkvm/kvm.c
172
if (flag & ~O_RDWR) {
lib/libssh/openbsd-compat/port-net.c
152
if ((fd = open(TUN_CTRL_DEV, O_RDWR)) == -1) {
lib/libssh/openbsd-compat/port-net.c
234
fd = open(name, O_RDWR);
lib/libssh/openbsd-compat/port-net.c
239
if ((fd = open(name, O_RDWR)) >= 0)
lib/libthread_xu/thread/thr_init.c
261
if ((fd = __sys_open(_PATH_CONSOLE, O_RDWR)) < 0)
lib/libthread_xu/thread/thr_sem.c
537
oflag |= O_RDWR;
lib/libthread_xu/thread/thr_sem.c
554
fd = __sys_open(path, O_RDWR | O_CLOEXEC);
lib/libthread_xu/thread/thr_sig.c
339
fd = open(buf, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0666);
lib/libusb/libusb20_ugen20.c
148
f = open(buf, O_RDWR);
lib/libusb/libusb20_ugen20.c
385
g = open(buf, O_RDWR);
lib/libusb/libusb20_ugen20.c
389
f = open(buf, O_RDWR);
lib/libutil/pty.c
53
master = posix_openpt(O_RDWR|O_NOCTTY);
lib/libutil/pty.c
67
slave = open(slavename, O_RDWR);
lib/libutil/uucplock.c
134
if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) < 0)
libexec/bootpd/bootpd.c
389
n = open(_PATH_TTY, O_RDWR);
libexec/bootpd/bootpgw/bootpgw.c
360
n = open(_PATH_TTY, O_RDWR);
libexec/bootpd/hwaddr.c
163
if ((fd=open("/dev/arp", O_RDWR)) < 0) {
libexec/dma/spool.c
130
queuefd = open_locked(it->queuefn, O_CREAT|O_EXCL|O_RDWR, 0660);
libexec/dma/spool.c
364
queuefd = open_locked(it->queuefn, O_RDWR|O_NONBLOCK);
libexec/ftpd/ftpd.c
3068
O_RDWR | O_CREAT | O_EXCL, 0666)) >= 0) {
libexec/getty/main.c
229
if (!opentty(ttyn, O_RDWR|O_NONBLOCK))
libexec/getty/main.c
267
if (!opentty(ttyn, O_RDWR | (NC ? O_NONBLOCK : 0 )))
libexec/rbootd/bpf.c
90
BpfFd = open(_PATH_BPF, O_RDWR);
libexec/telnetd/sys_term.c
871
t = open(_PATH_TTY, O_RDWR);
libexec/telnetd/sys_term.c
961
t = open(line, O_RDWR|O_NOCTTY);
libexec/telnetd/telnetd.c
850
t = open(_PATH_TTY, O_RDWR);
libexec/ypxfr/yp_dbwrite.c
67
#define FLAGS O_RDWR|O_EXLOCK|O_EXCL|O_CREAT
libexec/ypxfr/ypxfrd_getmap.c
125
if ((fp = open(tmpname, O_RDWR|O_CREAT, PERM_SECURE)) == -1) {
sbin/camcontrol/camcontrol.c
1120
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/camcontrol.c
1306
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/camcontrol.c
1313
device = cam_open_btl(mybus, mytarget, mylun, O_RDWR, NULL);
sbin/camcontrol/camcontrol.c
2131
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/camcontrol.c
360
if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) {
sbin/camcontrol/camcontrol.c
4054
cam_open_btl(bus, target, lun, O_RDWR, NULL) :
sbin/camcontrol/camcontrol.c
4055
cam_open_spec_device(device,unit,O_RDWR,NULL)))
sbin/ccdconfig/ccdconfig.c
438
if ((fd = open(path, O_RDWR, 0640)) < 0) {
sbin/clri/clri.c
75
if ((fd = open(fs, O_RDWR, 0)) < 0)
sbin/devfsctl/devfsctl.c
767
dev_fd = open("/dev/devfs", O_RDWR);
sbin/devfsctl/devfsctl.c
916
dev_fd = open("/dev/devfs", O_RDWR);
sbin/dhclient/bpf.c
70
sock = open("/dev/bpf", O_RDWR, 0);
sbin/dhclient/bpf.c
74
sock = open(filename, O_RDWR, 0);
sbin/dhclient/dhclient.c
1886
fd = open(buf, O_RDWR|O_CREAT, 0644);
sbin/dhclient/dhclient.c
341
fd = open(buf, O_RDWR, 0644);
sbin/dhclient/dhclient.c
356
if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
sbin/disklabel32/disklabel.c
243
f = open(specname, op == READ ? O_RDONLY : O_RDWR);
sbin/disklabel64/disklabel64.c
247
f = open(specname, op == READ ? O_RDONLY : O_RDWR);
sbin/fdisk/fdisk.c
791
O_RDWR : O_RDONLY);
sbin/fsck_msdosfs/check.c
54
dosfs = open(fname, rdonly ? O_RDONLY : O_RDWR, 0);
sbin/fsirand/fsirand.c
114
if ((devfd = open(device, printonly ? O_RDONLY : O_RDWR)) < 0) {
sbin/gpt/gpt.c
595
mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
sbin/hammer/cmd_cleanup.c
1289
int fd = open("/dev/null", O_RDWR);
sbin/hammer/cmd_config.c
152
fd = open(path, O_RDWR|O_CREAT|O_TRUNC, 0600);
sbin/hammer/cmd_mirror.c
1722
SFd = open(ScoreBoardFile, O_RDWR|O_CREAT|O_TRUNC, 0644);
sbin/hammer/cmd_recover.c
424
fd = open(path2, O_RDWR|O_CREAT, 0666);
sbin/hammer/cmd_recover.c
476
fd = open(path1, O_CREAT|O_RDWR, 0666);
sbin/hammer/cycle.c
80
if ((fd = open(CyclePath, O_RDWR|O_CREAT|O_TRUNC, 0666)) >= 0) {
sbin/hammer/hammer.c
572
__hammer_parse_blkdevs(blkdevs, O_RDWR, 0, 0);
sbin/hammer2/cmd_recover.c
1148
wfd = open(path1, O_RDWR|O_CREAT|O_TRUNC, 0600);
sbin/hammer2/cmd_service.c
1038
ttyfd = open("/dev/null", O_RDWR);
sbin/hammer2/cmd_service.c
1050
ttyfd = open("/dev/tty", O_RDWR);
sbin/hammer2/cmd_service.c
505
if ((fd = open(UDEV_DEVICE_PATH, O_RDWR)) < 0) {
sbin/hammer2/cmd_service.c
960
xfd = open("/dev/xdisk", O_RDWR, 0600);
sbin/hammer2/ondisk.c
212
fd = open(path, rdonly ? O_RDONLY : O_RDWR);
sbin/init/init.c
1609
if ((fd = open(_PATH_CONSOLE, O_RDWR)) == -1)
sbin/init/init.c
623
if ((fd = open(name, O_RDWR)) == -1) {
sbin/init/init.c
885
if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == NULL) {
sbin/iscontrol/fsm.c
283
fd = open(iscsidev, O_RDWR);
sbin/iscontrol/fsm.c
301
nfd = open(dev, O_RDWR);
sbin/iscontrol/fsm.c
367
sess->cam.target_lun[i], O_RDWR, NULL);
sbin/jscan/dump_mirror.c
441
if ((fd = open(jattr->pathref, O_RDWR)) >= 0) {
sbin/jscan/dump_mirror.c
530
if ((fd = open(jattr->pathref, O_RDWR)) >= 0) {
sbin/jscan/dump_mirror.c
612
if ((fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0600)) >= 0) {
sbin/jscan/jfile.c
125
if ((fd = open(data, O_RDWR|O_CREAT, 0666)) >= 0)
sbin/jscan/jfile.c
138
jf->jf_open_flags = rw ? (O_RDWR|O_CREAT) : O_RDONLY;
sbin/jscan/jfile.c
182
fd = open(data, O_RDWR, 0666);
sbin/jscan/jfile.c
184
fd = open(data, O_RDWR|O_CREAT, 0666);
sbin/jscan/jfile.c
589
jf->jf_write_fd = open(path, O_RDWR|O_CREAT, 0666);
sbin/jscan/jsession.c
65
ss->ss_transid_fd = open(ss->ss_transid_file, O_RDWR|O_CREAT, 0666);
sbin/mountctl/mountctl.c
254
if ((fd = open(wopt, O_RDWR|O_CREAT|O_APPEND, 0666)) < 0) {
sbin/natacontrol/natacontrol.c
477
if ((fd = open("/dev/ata", O_RDWR)) < 0)
sbin/newfs/fscopy.c
302
if ((fd = open(path, O_RDWR|O_CREAT|O_TRUNC, 0600)) < 0) {
sbin/newfs/mkfs.c
201
fd = open(filename, O_RDWR|O_TRUNC|O_CREAT, 0644);
sbin/newfs_hammer/newfs_hammer.c
191
volume = init_volume(av[i], O_RDWR, i);
sbin/newfs_hammer2/mkfs_hammer2.c
714
int fd = open(av[i], O_RDWR);
sbin/newfs_msdos/mkfs_msdos.c
272
fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644);
sbin/newfs_msdos/mkfs_msdos.c
281
} else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1) {
sbin/nos-tun/nos-tun.c
114
tun = open(tun_dev, O_RDWR);
sbin/nvmectl/nvmectl.c
108
fd = open(path, O_RDWR);
sbin/nvmectl/nvmectl.c
89
fd = open(path, O_RDWR);
sbin/rconfig/client.c
114
ffd = open(path, O_CREAT|O_TRUNC|O_RDWR, 0755);
sbin/restore/dirs.c
149
fd = open(dirfile, O_RDWR|O_CREAT|O_EXCL, 0666);
sbin/restore/dirs.c
162
fd = open(modefile, O_RDWR|O_CREAT|O_EXCL, 0666);
sbin/routed/trace.c
190
fd = open(_PATH_DEVNULL, O_RDWR);
sbin/savecore/savecore.c
253
fd = open(device, O_RDWR);
sbin/slattach/slattach.c
278
if ((fd = open(dev, O_RDWR | O_NONBLOCK, 0)) < 0) {
sbin/startslip/startslip.c
293
if ((fd = open(devicename, O_RDWR | O_NONBLOCK)) < 0) {
sbin/svc/execute.c
179
if ((tfd = open("/dev/tty", O_RDWR)) >= 0) {
sbin/svc/execute.c
78
if ((xfd = open("/dev/null", O_RDWR)) < 0) {
sbin/svc/subs.c
113
*pfdp = open(pidfile, O_RDWR|O_CREAT|O_EXLOCK|O_NONBLOCK, 0640);
sbin/swapon/swapon.c
332
fd = open(name, O_RDWR);
sbin/tunefs/tunefs.c
322
fi = open(file, O_RDWR);
sbin/udevd/udevd.c
399
if ((udevfd = open(UDEV_DEVICE_PATH, O_RDWR | O_NONBLOCK)) == -1)
sbin/vinum/commands.c
364
if ((plexfh = open(filename, O_RDWR, S_IRWXU)) < 0) { /* got a plex, open it */
sbin/vinum/commands.c
451
if ((sdfh = open(filename, O_RDWR, S_IRWXU)) < 0) { /* no go */
sbin/vinum/commands.c
722
superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* reopen vinum superdevice */
sbin/vinum/v.c
145
superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* open vinum superdevice */
sbin/vinum/v.c
148
superdev = open(VINUM_WRONGSUPERDEV_NAME, O_RDWR); /* do we have a debug mismatch? */
sbin/vinum/v.c
557
superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* open the super device */
sbin/vinum/v.c
832
superdev = open(VINUM_DAEMON_DEV_NAME, O_RDWR); /* open deamon superdevice */
share/examples/kld/cdev/test/testcdev.c
96
if ((kernel_fd = open("/dev/" CDEV_DEVICE, O_RDWR)) == -1) {
share/examples/ppi/ppilcd.c
325
if ((hd_fd = open(devname, O_RDWR, 0)) == -1)
share/examples/scsi_target/scsi_target.c
192
file_fd = open(file_name, O_RDWR);
share/examples/scsi_target/scsi_target.c
239
targ_fd = open(targname, O_RDWR);
share/examples/ses/srcs/chpmon.c
73
fd = open(v[dev], O_RDWR);
share/examples/ses/srcs/inienc.c
51
fd = open(*v, O_RDWR);
share/examples/ses/srcs/sesd.c
120
fd = open(v[dev], O_RDWR);
share/examples/ses/srcs/sesd.c
95
fd = open(v[dev], O_RDWR);
share/examples/ses/srcs/setencstat.c
56
fd = open(v[1], O_RDWR);
share/examples/ses/srcs/setobjstat.c
60
fd = open(v[1], O_RDWR);
sys/bus/cam/scsi/scsi_sa.c
488
softc->open_rdonly = (ap->a_oflags & O_RDWR) == O_RDONLY;
sys/bus/u4b/uvc/uvc_buf.c
740
error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, O_CREAT | O_RDWR, 0666);
sys/dev/drm/include/uapi/drm/drm.h
699
#define DRM_RDWR O_RDWR
sys/dev/smbus/atmel_mxt/test_atmel.c
173
fd = open("/dev/smb1-4a", O_RDWR);
sys/dev/smbus/cyapa/test_cyapa.c
93
fd = open("/dev/smb0-67", O_RDWR);
sys/kern/sys_mqueue.c
433
if ((oflag & O_ACCMODE) == (O_WRONLY | O_RDWR)) {
sys/kern/vfs_syscalls.c
2204
if (flags & O_RDWR)
sys/net/netmap/netmap_user.h
190
d->fd = open("/dev/netmap", O_RDWR);
sys/platform/vkernel64/platform/init.c
1029
#define TAPDEV_OFLAGS (O_RDWR | O_NONBLOCK)
sys/platform/vkernel64/platform/init.c
1390
fd = open(pid_file, O_RDWR|O_CREAT|O_EXLOCK|O_NONBLOCK, 0666);
sys/platform/vkernel64/platform/init.c
557
fd = open(tmpfile, O_RDWR|O_CREAT|O_EXCL, 0600);
sys/platform/vkernel64/platform/init.c
871
fd = open(fname, O_RDWR|O_DIRECT, 0644);
sys/vfs/dirfs/dirfs_subr.c
587
flags |= O_RDWR;
sys/vfs/dirfs/dirfs_vnops.c
245
(O_CREAT | O_RDWR));
test/debug/kwrite.c
57
kvm = kvm_openfiles(NULL, NULL, NULL, O_RDWR, errbuf);
test/debug/posixlock.c
58
if ((fd = open("test", O_CREAT|O_RDWR, 0666)) < 0) {
test/debug/testvblank.c
22
fd = open("/dev/dri/card0", O_RDWR);
test/debug/umtx.c
81
if ((fd = open(path, O_RDWR|O_CREAT, 0666)) < 0) {
test/illumos/oclo/oclo.c
1221
int flags = O_RDWR | O_CLOFORK;
test/illumos/oclo/oclo.c
226
int flags = O_RDWR, fd;
test/illumos/oclo/oclo_errors.c
137
if (!oclo_dup3("dup3(): O_RDWR", O_RDWR)) {
test/illumos/oclo/oclo_errors.c
163
if (!oclo_pipe2("pipe2(): O_RDWR", O_RDWR)) {
test/lockf/lockf.c
142
fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
test/lockf/lockf.c
81
fd = open (lockfile, O_RDWR, 0);
test/stress/fsstress/fsstress.c
1385
fd = open_path(&f, O_RDWR);
test/stress/fsstress/fsstress.c
1948
fd = open_path(&f, O_RDWR);
test/stress/fsstress/fsstress.c
2321
fd = open_path(&f, O_RDWR);
test/stress/fsstress/fsstress.c
2539
fd = open_path(&f, O_RDWR);
test/stress/fsx/fsx.c
1126
fd = open(fname, O_RDWR|(lite ? 0 : O_CREAT|O_TRUNC), 0666);
test/stress/fsx/fsx.c
1133
fsxgoodfd = open(goodfile, O_RDWR|O_CREAT|O_TRUNC, 0666);
test/stress/fsx/fsx.c
803
fd = open(fname, O_RDWR, 0);
test/stress/stress2/lib/resources.c
170
if ((dffd = open(dfpath, O_RDWR, 0644)) == -1) {
test/stress/stress2/lib/resources.c
201
if ((dffd = open(dfpath, O_RDWR, 0644)) == -1) {
test/stress/stress2/testcases/lockf/lockf.c
96
if ((fd = open(file,O_CREAT | O_TRUNC | O_RDWR, 0600)) == -1)
test/stress/stress2/testcases/lockf2/lockf2.c
58
if ((fd = open(file,O_CREAT | O_TRUNC | O_RDWR, 0600)) == -1)
test/stress/stress2/testcases/lockf2/lockf2.c
81
if ((fd = open(file, O_RDWR, 0600)) == -1)
test/stress/stress2/testcases/mkfifo/mkfifo.c
52
if ((fd = open(path, O_RDWR, 0600)) < 0) {
test/stress/stress2/testcases/mkfifo/mkfifo.c
73
if ((fd = open(path, O_RDWR, 0600)) < 0) {
test/stress/stress2/testcases/mmap/mmap.c
87
if ((fdout = open(file, O_RDWR | O_CREAT | O_TRUNC, 0600)) < 0)
test/stress/tuxload.c
179
if ((fd[i] = open(name, O_RDWR)) < 1) {
test/stress/tuxload.c
180
if ((fd[i] = open(name, O_RDWR | O_CREAT, 0644)) < 1) {
test/sysperf/lockmgr2.c
30
close(open("/tmp/lockmgr2.test", O_RDWR|O_CREAT, 0666));
test/sysperf/lockmgr2.c
50
close(open(path, O_RDWR|O_CREAT, 0666));
test/sysperf/lockmgr3.c
30
fd = open("/tmp/lockmgr3.test", O_RDWR|O_CREAT, 0666);
test/sysperf/lockmgr3.c
52
fd = open(path, O_RDWR|O_CREAT, 0666);
test/sysperf/read1.c
46
fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
test/sysperf/read1.c
50
fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
test/testcases/io/poll_1/poll_1.c
14
int p = open("/dev/tty", O_RDWR);
test/testcases/mem/mmap_madvise_1/mmap_madvise_1.c
39
fd = open(tmpfile, O_RDWR | O_CREAT | O_TRUNC, 0777);
test/unix/passdesc/passdesc.c
166
fd = open(TEST_FILENAME, O_RDWR | O_TRUNC | O_CREAT,
tools/regression/nfsmmap/test1/test1.c
21
fd = open("test1.data", O_RDWR|O_CREAT, 0666);
tools/regression/nfsmmap/test1/test1.c
29
fd = open("test1.data", O_RDWR);
tools/regression/nfsmmap/test1/test1.c
44
fd2 = open("test1.scratch", O_RDWR|O_CREAT, 0666);
tools/regression/nfsmmap/test2/test2.c
21
fd = open("test2.data", O_RDWR|O_CREAT, 0666);
tools/regression/nfsmmap/test2/test2.c
29
fd = open("test2.data", O_RDWR);
tools/regression/nfsmmap/test2/test2.c
42
fd2 = open("test2.scratch", O_RDWR|O_CREAT, 0666);
tools/regression/p1003_1b/sched.c
221
q(__LINE__, (fd = open(nam, O_RDWR|O_CREAT, 0666)),
tools/tools/net80211/stumbler/stumbler.c
312
fd = open(buf, O_RDWR);
tools/tools/net80211/w00t/libw00t/w00t.c
251
return open(buf, O_RDWR);
tools/tools/net80211/w00t/libw00t/w00t.c
98
fd = open(buf, O_RDWR);
tools/tools/net80211/wesside/wesside/wesside.c
2171
tapfd = open(TAP_DEV, O_RDWR);
tools/tools/net80211/wesside/wesside/wesside.c
436
fd = open(buf, O_RDWR);
tools/tools/net80211/wesside/wesside/wesside.c
944
fd = open(path, O_RDWR);
tools/tools/net80211/wlaninject/wlaninject.c
95
fd = open(buf, O_RDWR);
tools/tools/netrate/netperf/tcp_cc/tcp_cc.c
79
null_fd = open("/dev/null", O_RDWR);
tools/tools/netrate/netperf/tcp_stream/tcp_stream.c
180
null_fd = open("/dev/null", O_RDWR);
usr.bin/backlight/backlight.c
149
if ((fd = open(device_name, O_RDWR)) == -1)
usr.bin/brandelf/brandelf.c
118
if ((fd = open(argv[0], change || force ? O_RDWR : O_RDONLY, 0)) < 0) {
usr.bin/cap_mkdb/cap_mkdb.c
111
if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
usr.bin/crunch/crunchide/crunchide.c
216
fd = open(filename, O_RDWR, 0);
usr.bin/dfregress/kernel.c
91
fd = open("/dev/tbridge", O_RDWR);
usr.bin/dsynth/build.c
2132
tmpfd = open(pkg.logfile, O_RDWR|O_CREAT|O_TRUNC, 0666);
usr.bin/dsynth/build.c
214
CheckDBM = dbm_open(dbmpath, O_CREAT|O_RDWR, 0644);
usr.bin/dsynth/build.c
2428
slavefd = open(ptsname(MasterPtyFd), O_RDWR);
usr.bin/dsynth/build.c
2568
fd = open("/dev/null", O_RDWR);
usr.bin/dsynth/build.c
2622
fdlog = open(pkg->logfile, O_RDWR|O_CREAT|O_APPEND, 0644);
usr.bin/dsynth/build.c
3068
fd2 = open(tmp, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0644);
usr.bin/dsynth/dsynth.c
322
fd = open(lkpath, O_RDWR | O_CREAT | O_APPEND, 0644);
usr.bin/dsynth/dsynth.c
341
lkfd = open(lkpath, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
usr.bin/dsynth/monitor.c
212
LockFd = open(lkfile, O_RDWR);
usr.bin/dsynth/monitor.c
78
StatsFd = open(StatsFilePath, O_RDWR|O_CREAT|O_CLOEXEC, 0644);
usr.bin/dsynth/monitor.c
83
LockFd = open(StatsLockPath, O_RDWR|O_CREAT|O_NOFOLLOW|O_CLOEXEC,
usr.bin/dsynth/mount.c
141
fd = open(goodbuf, O_RDWR|O_CREAT|O_TRUNC, 0644);
usr.bin/dsynth/subs.c
159
(void)dlogfd(i, O_RDWR|O_CREAT|O_TRUNC|O_APPEND);
usr.bin/dsynth/subs.c
214
fd = dlogfd(DLOG_ALL, O_RDWR|O_CREAT|O_APPEND);
usr.bin/dsynth/subs.c
222
fd = dlogfd(which, O_RDWR|O_CREAT|O_APPEND);
usr.bin/dsynth/subs.c
248
return(dlogfd(DLOG_ALL, O_RDWR|O_CREAT|O_APPEND));
usr.bin/dsynth/subs.c
534
nullfd = open("/dev/null", O_RDWR | O_CLOEXEC);
usr.bin/finger/util.c
156
(db = dbopen(NULL, O_RDWR, 0, DB_BTREE, NULL)) == NULL)
usr.bin/gcore/gcore.c
165
fd = open(corefile, O_RDWR|O_CREAT|O_TRUNC, DEFFILEMODE);
usr.bin/gzip/gzip.c
1509
ofd = open(outfile, O_RDWR, 0);
usr.bin/kcollect/kcollect.c
617
db = dbm_open(datafile, (O_RDWR),
usr.bin/kcollect/kcollect.c
666
db = dbm_open(datafile, (O_RDWR | O_CREAT),
usr.bin/mail/names.c
317
image = open(tempname, O_RDWR);
usr.bin/msgs/msgs.c
761
fd = open(fname, O_RDWR|O_EXCL|O_CREAT|O_APPEND);
usr.bin/mt/mt.c
175
if ((mtfd = open(tape, comp->c_ronly ? O_RDONLY : O_RDWR)) < 0)
usr.bin/nohup/nohup.c
105
fd = open(p = path, O_RDWR | O_CREAT | O_APPEND,
usr.bin/nohup/nohup.c
99
fd = open(p, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
usr.bin/rfcomm_sppd/rfcomm_sppd.c
306
if ((master = open(pty, O_RDWR, 0)) < 0)
usr.bin/shlock/shlock.c
127
while ((fd = open(tmpf, O_RDWR | O_CREAT | O_EXCL, 0644)) == -1){
usr.bin/tcopy/tcopy.c
117
op == COPY ? O_WRONLY : O_RDWR, DEFFILEMODE)) < 0)
usr.bin/tip/hunt.c
78
FD = open(cp, O_RDWR);
usr.bin/truss/setup.c
104
fd = open(buf, O_RDWR);
usr.bin/truss/setup.c
137
fd = open(buf, O_RDWR);
usr.bin/truss/x86_64-fbsd.c
121
fd = open(buf, O_RDWR);
usr.bin/tsort/tsort.c
237
(db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == NULL)
usr.bin/u4bhidctl/usbhid.c
509
f = open(dev, O_RDWR);
usr.bin/unzip/unzip.c
644
if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0)
usr.bin/usbhidaction/usbhidaction.c
149
fd = open(dev, O_RDWR);
usr.bin/vknet/vknet.c
294
tap_fd = open(buf, O_RDWR | O_NONBLOCK);
usr.bin/vknet/vknet.c
303
tap_fd = open(buf, O_RDWR | O_NONBLOCK);
usr.bin/vknet/vknet.c
306
} else if ((tap_fd = open(localSide, O_RDWR | O_NONBLOCK)) >= 0) {
usr.bin/xinstall/xinstall.c
991
return (open(path, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR));
usr.sbin/acpi/acpicall/acpicall.c
174
fd = open(dev_path, O_RDWR);
usr.sbin/acpi/acpiconf/acpiconf.c
49
acpifd = open(ACPIDEV, O_RDWR);
usr.sbin/authpf/authpf.c
126
dev_fd = open(PATH_DEVFILE, O_RDWR);
usr.sbin/authpf/authpf.c
203
if ((pidfd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1 ||
usr.sbin/autofs/automountd.c
482
autofs_fd = open(AUTOFS_PATH, O_RDWR | O_CLOEXEC);
usr.sbin/autofs/automountd.c
487
autofs_fd = open(AUTOFS_PATH, O_RDWR | O_CLOEXEC);
usr.sbin/autofs/common.c
1174
fd = open(_PATH_DEVNULL, O_RDWR, 0);
usr.sbin/autofs/popen.c
82
nullfd = open(_PATH_DEVNULL, O_RDWR, 0);
usr.sbin/bthcid/parser.y
361
if ((f = open(tmp, O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0600)) < 0) {
usr.sbin/burncd/burncd.c
138
if ((fd = open(dev, O_RDWR, 0)) < 0)
usr.sbin/clog/clog.c
197
fd = open(lname,O_RDWR|O_CREAT,0666);
usr.sbin/cpucontrol/amd.c
98
devfd = open(dev, O_RDWR);
usr.sbin/cpucontrol/amd10h.c
119
devfd = open(dev, O_RDWR);
usr.sbin/cpucontrol/cpucontrol.c
344
fd = open(dev, O_RDWR);
usr.sbin/cpucontrol/intel.c
113
devfd = open(dev, O_RDWR);
usr.sbin/cpucontrol/via.c
107
devfd = open(dev, O_RDWR);
usr.sbin/cron/cron/popen.c
126
open(_PATH_DEVNULL, O_RDWR);
usr.sbin/cron/cron/popen.c
140
open(_PATH_DEVNULL, O_RDWR);
usr.sbin/cron/cron/popen.c
142
open(_PATH_DEVNULL, O_RDWR);
usr.sbin/cron/lib/misc.c
243
if ((-1 == (fd = open(pidfile, O_RDWR|O_CREAT, 0644)))
usr.sbin/dconschat/dconschat.c
908
dc->fd = open(devicename, O_RDWR);
usr.sbin/dconschat/dconschat.c
924
(dc->flags & F_RD_ONLY) ? O_RDONLY : O_RDWR, "dconschat");
usr.sbin/edquota/edquota.c
349
fd = open(qfpathname, O_RDWR|O_CREAT, 0640);
usr.sbin/fdformat/fdformat.c
323
if ((fd = open(dev_name, O_RDWR)) < 0)
usr.sbin/fdwrite/fdwrite.c
132
if((fd = open(device, O_RDWR)) < 0)
usr.sbin/ftp-proxy/filter.c
174
dev = open("/dev/pf", O_RDWR);
usr.sbin/fwcontrol/fwcontrol.c
426
if ((fd = open(devicename, O_RDWR)) >= 0)
usr.sbin/installer/dfuibe_installer/fn_configure.c
421
fd = open("/tmp/t1", O_RDWR | O_CREAT | O_TRUNC,
usr.sbin/lpr/lpd/printjob.c
1753
pfd = open(pp->lp, pp->rw ? O_RDWR : O_WRONLY);
usr.sbin/lpr/lpr/lpr.c
494
if ((tfd = open(tfname, O_RDWR)) >= 0) {
usr.sbin/lpr/lpr/lpr.c
842
if ((fd = open(buf, O_RDWR|O_CREAT, 0661)) < 0) {
usr.sbin/makefs/ffs.c
513
int oflags = O_RDWR | O_CREAT;
usr.sbin/makefs/hammer2.c
320
fsopts->fd = open(image, O_RDWR);
usr.sbin/makefs/hammer2.c
843
if ((fsopts->fd = open(image, O_RDWR)) == -1) {
usr.sbin/makefs/hammer2.c
882
oflags = O_RDWR | O_CREAT;
usr.sbin/makefs/msdos.c
183
fsopts->fd = open(image, O_RDWR);
usr.sbin/mfiutil/mfi_cmd.c
311
return (open(path, O_RDWR));
usr.sbin/mixer/mixer.c
157
if ((baz = open(name, O_RDWR)) < 0)
usr.sbin/moused/moused.c
788
rodent.mfd = open(rodent.portname, O_RDWR | O_NONBLOCK);
usr.sbin/moused/moused.c
901
if ((rodent.cfd = open("/dev/consolectl", O_RDWR, 0)) == -1)
usr.sbin/mpsutil/mps_cmd.c
625
return (open(path, O_RDWR));
usr.sbin/mpsutil/mps_flash.c
92
fd = open(firmware_file, O_CREAT | O_TRUNC | O_RDWR, 0644);
usr.sbin/mptable/mptable.c
815
ofd = open( "/tmp/mpdump", O_CREAT | O_RDWR );
usr.sbin/mptutil/mpt_cam.c
498
dev = cam_open_device(disks[count].devname, O_RDWR);
usr.sbin/mptutil/mpt_cam.c
54
xptfd = open(XPT_DEVICE, O_RDWR);
usr.sbin/mptutil/mpt_cmd.c
553
return (open(path, O_RDWR));
usr.sbin/mptutil/mpt_config.c
77
vfd = open(path, O_RDWR);
usr.sbin/mptutil/mpt_config.c
93
dfd = open(path, O_RDWR);
usr.sbin/pciconf/pciconf.c
186
O_RDWR : O_RDONLY, 0);
usr.sbin/pciconf/pciconf.c
804
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pciconf/pciconf.c
836
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pciconf/pciconf.c
852
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pfctl/pfctl.c
2008
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2017
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2028
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2040
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2049
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2065
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2118
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2122
mode = O_RDWR;
usr.sbin/pfctl/pfctl.c
2140
mode = strchr("acdefkrz", ch) ? O_RDWR : O_RDONLY;
usr.sbin/pflogd/privsep.c
145
O_RDWR|O_CREAT|O_APPEND|O_NONBLOCK|O_NOFOLLOW,
usr.sbin/powerd/powerd.c
306
PowerFd = open("/var/run/powerd.pid", O_CREAT|O_RDWR, 0644);
usr.sbin/ppp/bundle.c
727
bundle.dev.fd = ID0open(bundle.dev.Name, O_RDWR);
usr.sbin/ppp/chap.c
309
if (open(_PATH_DEVNULL, O_RDWR) != STDERR_FILENO) {
usr.sbin/ppp/chat.c
741
if (open(_PATH_TTY, O_RDWR) != 3)
usr.sbin/ppp/chat.c
742
open(_PATH_DEVNULL, O_RDWR); /* Leave it closed if it fails... */
usr.sbin/ppp/command.c
635
else if ((fd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
usr.sbin/ppp/main.c
319
if ((holdfd[0] = open(_PATH_DEVNULL, O_RDWR)) == -1) {
usr.sbin/ppp/physical.c
1016
p->fd = ID0open(p->name.full, O_RDWR | O_NONBLOCK);
usr.sbin/procctl/procctl.c
84
fd = open(buf, O_RDWR);
usr.sbin/pw/cpdir.c
93
} else if (S_ISREG(st.st_mode) && (outfd = open(dst, O_RDWR | O_CREAT | O_EXCL, st.st_mode)) != -1) {
usr.sbin/pw/edgroup.c
68
if ((infd = open(groupfile, O_RDWR | O_CREAT | O_EXLOCK, 0644)) != -1) {
usr.sbin/pw/edgroup.c
76
if ((outfd = open(grouptmp, O_RDWR | O_CREAT | O_TRUNC, 0644)) != -1) {
usr.sbin/pw/fileupd.c
76
int infd = open(filename, O_RDWR | O_CREAT | O_EXLOCK, fmode);
usr.sbin/pw/fileupd.c
92
outfd = open(file, O_RDWR | O_CREAT | O_TRUNC, fmode);
usr.sbin/pw/pw_conf.c
383
if ((fd = open(file, O_CREAT | O_RDWR | O_TRUNC | O_EXLOCK, 0644)) != -1) {
usr.sbin/pw/pw_user.c
746
close(open(line, O_RDWR | O_CREAT, 0600)); /* Preserve contents &
usr.sbin/pwd_mkdb/pwd_mkdb.c
212
O_RDWR|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo);
usr.sbin/pwd_mkdb/pwd_mkdb.c
219
O_RDWR|O_EXCL, PERM_SECURE, DB_HASH, &openinfo);
usr.sbin/pwd_mkdb/pwd_mkdb.c
276
O_RDWR|O_CREAT|O_EXCL, PERM_INSECURE, DB_HASH, &openinfo);
usr.sbin/pwd_mkdb/pwd_mkdb.c
282
O_RDWR|O_CREAT|O_EXCL, PERM_SECURE, DB_HASH, &openinfo);
usr.sbin/rarpd/rarpd.c
352
fd = open(device, O_RDWR);
usr.sbin/rpc.lockd/lockd_lock.c
410
fl->fd = fhopen(&fl->filehandle, O_RDWR);
usr.sbin/rpc.statd/file.c
147
status_fd = open(filename, O_RDWR);
usr.sbin/rpc.statd/file.c
150
status_fd = open(filename, O_RDWR | O_CREAT, 0644);
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
399
#define FLAGS O_RDWR|O_CREAT
usr.sbin/rpc.ypupdated/yp_dbupdate.c
90
dbp = yp_open_db_rw(domptr, map, O_RDWR);
usr.sbin/sa/main.c
305
fd = open(pn, wr ? O_RDWR : O_RDONLY, 0);
usr.sbin/sa/pdb.c
162
saved_pacct_db = dbopen(_PATH_SAVACCT, O_RDWR|O_CREAT|O_TRUNC, 0644,
usr.sbin/sa/pdb.c
225
output_pacct_db = dbopen(NULL, O_RDWR, 0, DB_BTREE, &bti);
usr.sbin/sa/pdb.c
55
pacct_db = dbopen(NULL, O_RDWR, 0, DB_BTREE, NULL);
usr.sbin/sa/usrdb.c
181
saved_usracct_db = dbopen(_PATH_USRACCT, O_RDWR|O_CREAT|O_TRUNC, 0644,
usr.sbin/sa/usrdb.c
60
usracct_db = dbopen(NULL, O_RDWR, 0, DB_BTREE, &bti);
usr.sbin/sliplogin/sliplogin.c
382
if ((fd = open(argv[2], O_RDWR)) == -1) {
usr.sbin/syslogd/syslogd.c
2142
if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
usr.sbin/syslogd/syslogd.c
2476
if ((nulldesc = open(_PATH_DEVNULL, O_RDWR)) == -1)
usr.sbin/sysvipcd/shmd.c
106
fd = open(filename, O_RDWR | O_CREAT, 0666);
usr.sbin/vknetd/vknetd.c
206
tap_fd = open("/dev/tap", O_RDWR);
usr.sbin/vknetd/vknetd.c
209
tap_fd = open(buf, O_RDWR | O_NONBLOCK);
usr.sbin/vknetd/vknetd.c
212
tap_fd = open(tapName, O_RDWR | O_NONBLOCK);
usr.sbin/vnconfig/vnconfig.c
376
fd = open(file, O_RDWR|O_CREAT|O_TRUNC, 0600);
usr.sbin/vnconfig/vnconfig.c
378
fd = open(file, O_RDWR);
usr.sbin/watch/watch.c
160
mode = O_RDWR;
usr.sbin/watchdogd/watchdogd.c
136
if ((fd = open("/dev/wdog", O_RDWR)) == -1) {
usr.sbin/yp_mkdb/yp_mkdb.c
194
if ((dbp = open_db(map, O_RDWR|O_EXLOCK|O_EXCL|O_CREAT)) == NULL)
usr.sbin/ypbind/ypbind.c
904
if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1) {
usr.sbin/ypbind/ypbind.c
906
if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1)
usr.sbin/ypbind/ypbind.c
910
if ((fd = open(path, O_CREAT|O_RDWR|O_TRUNC, 0644)) == -1) {
usr.sbin/ypbind/ypbind.c
912
if ((fd = open(path, O_CREAT|O_RDWR|O_TRUNC, 0644)) == -1)