Symbol: O_TRUNC
bin/cp/utils.c
158
to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
bin/cp/utils.c
160
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
bin/cp/utils.c
169
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
bin/csh/csh.c
903
if ((fp = open(short2str(hfile), O_WRONLY | O_CREAT | O_TRUNC,
bin/csh/dol.c
829
if (open(tmp, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600) < 0) {
bin/csh/sem.c
593
if ((fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
bin/dd/args.c
463
{ "trunc", O_TRUNC, C_OFLAG },
bin/dd/dd.c
208
if ((oflag & O_TRUNC) && (ddflags & C_SEEK)) {
bin/dd/dd.c
213
if ((oflag & O_TRUNC) && (ddflags & C_NOTRUNC)) {
bin/dd/dd.c
220
(oflag | (ddflags & (C_SEEK | C_NOTRUNC) ? 0 : O_TRUNC))
bin/ksh/exec.c
1148
flags = O_WRONLY | O_CREAT | O_TRUNC;
bin/ksh/history.c
756
if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0600)) != -1) {
bin/ksh/io.c
478
fd = open(pathx, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600);
bin/mv/mv.c
287
open(to, O_CREAT | O_TRUNC | O_WRONLY, sbp->st_mode)) < 0) {
bin/pax/ar_io.c
80
#define AR_MODE (O_WRONLY | O_CREAT | O_TRUNC) /* mode for archive */
bin/pax/file_subs.c
141
return (open(arcn->name, O_TRUNC | O_EXCL | O_RDWR, 0));
bin/sh/histedit.c
540
fd = open_history_file(file, O_WRONLY|O_CREAT|O_TRUNC);
bin/sh/redir.c
432
if ((f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
bin/sh/redir.c
955
#ifndef O_TRUNC
bin/sh/redir.c
977
O_NOFOLLOW|O_CREAT|O_TRUNC|O_EXCL|O_NOCTTY|O_DIRECTORY|O_REGULAR)
common/dist/zlib/examples/gun.c
572
outfile = open(outname, O_CREAT | O_TRUNC | O_WRONLY, 0666);
common/dist/zlib/examples/gzlog.c
1016
fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
common/dist/zlib/examples/gzlog.c
955
fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
common/dist/zlib/examples/gzlog.c
965
fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
common/dist/zlib/gzlib.c
243
O_TRUNC :
lib/libc/compat-43/creat.c
51
return(open(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
lib/libc/db/db/db.c
66
O_RDWR | O_SHLOCK | O_TRUNC | O_CLOEXEC)
lib/libc/db/hash/hash.c
125
if (!file || (flags & O_TRUNC) ||
lib/libc/gmon/gmon.c
445
#define OPEN_FLAGS (O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC)
lib/libc/stdio/flags.c
75
o = O_CREAT | O_TRUNC;
lib/libc/stdio/fmemopen.c
207
if (oflags & O_TRUNC)
lib/libedit/history.c
893
if ((i = open(fname, O_WRONLY|O_CREAT|O_TRUNC,
lib/libperfuse/ops.c
1225
fci->flags = O_CREAT | O_TRUNC | O_RDWR;
lib/libpuffs/null.c
342
fd = open(PCNPATH(pcn), O_RDWR | O_CREAT | O_TRUNC);
lib/librefuse/refuse.c
790
fi->flags = (mode & ~(O_CREAT | O_EXCL | O_TRUNC)) - 1;
lib/librmt/rmtlib.c
837
return open(path, O_CREAT | O_TRUNC | O_WRONLY, mode);
lib/libutil/pidlock.c
88
if ((f = open(tempfile, O_WRONLY|O_CREAT|O_TRUNC, 0600)) == -1)
libexec/tftpd/tftpd.c
885
trunc = O_TRUNC;
regress/sys/kern/unfdpass/unfdpass.c
150
if ((fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
sbin/fsdb/fsdb.c
1759
wrinfo.fd = open(argv[1], O_WRONLY | O_TRUNC | O_CREAT, 0644);
sbin/fsdb/fsdb.c
572
wrinfo.fd = open(argv[1], O_WRONLY | O_TRUNC | O_CREAT, 0644);
sbin/newfs_msdos/mkfs_msdos.c
285
oflags |= O_TRUNC;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
134
fd = open(device, O_RDWR|O_CREAT|O_TRUNC, 0666);
sbin/newfs_udf/newfs_udf.c
258
error = udf_opendisc(dev_name, O_RDWR | O_CREAT | O_TRUNC);
sbin/newfs_udf/udf_core.c
3357
dev_fd = open(dev_name, O_RDWR | O_CREAT | O_TRUNC, 0666);
sbin/newfs_v7fs/newfs_v7fs.c
166
fd = open(device, O_RDWR|O_CREAT|O_TRUNC, 0666);
sbin/nvmectl/wdc.c
125
fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sbin/restore/dirs.c
723
if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
sbin/restore/tape.c
792
if (!Nflag && (ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC,
sbin/rndctl/rndctl.c
267
if ((fd_seed = open(tmp, O_CREAT|O_TRUNC|O_WRONLY, 0600)) == -1)
sbin/rndctl/rndctl.c
309
if ((fd_new = open(tmp, O_CREAT|O_TRUNC|O_WRONLY, 0600)) == -1) {
sbin/savecore/savecore.c
929
fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
sbin/shutdown/shutdown.c
558
if ((fastfd = open(_PATH_FASTBOOT, O_WRONLY|O_CREAT|O_TRUNC,
sbin/shutdown/shutdown.c
580
if ((logfd = open(_PATH_NOLOGIN, O_WRONLY|O_CREAT|O_TRUNC,
sys/arch/amiga/dev/mfc.c
572
if ((flag & O_TRUNC) && (tp->t_state & TS_TTSTOP)) {
sys/arch/amiga/dev/msc.c
465
if ((flag & O_TRUNC) && (tp->t_state & TS_TTSTOP)) {
sys/arch/ews4800mips/stand/common/coffhdrfix.c
118
if ((fdout = open(argp[2], O_CREAT | O_TRUNC | O_RDWR, 0644)) < 0) {
sys/arch/hp300/stand/mkboot/mkboot.c
152
if ((to = open(argv[0], O_WRONLY | O_TRUNC | O_CREAT, 0644)) == -1)
sys/arch/hppa/stand/mkboot/mkboot.c
166
if ((to = open(to_file, O_RDWR | O_TRUNC | O_CREAT, 0644)) < 0)
sys/arch/macppc/stand/mkboothfs/mkboothfs.c
84
if ((ofd = open(boothfs, O_CREAT | O_TRUNC | O_WRONLY, 0644)) == -1)
sys/arch/mvme68k/stand/wrtvid/wrtvid.c
168
if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
323
if ((prep_fd = open(outname, O_RDWR|O_TRUNC, 0)) < 0) {
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
491
if ((rs6000_fd = open(outname, O_RDWR|O_TRUNC, 0)) < 0) {
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
719
if ((bebox_fd = open(outname, O_RDWR|O_TRUNC, 0)) < 0) {
sys/coda/coda_venus.c
152
if (from & O_TRUNC) to |= C_O_TRUNC; \
sys/coda/coda_vnops.c
242
if (flag & (FWRITE | O_TRUNC | O_CREAT | O_EXCL)) {
sys/compat/common/vfs_syscalls_43.c
311
SCARG(&nuap, flags) = O_WRONLY | O_CREAT | O_TRUNC;
sys/compat/linux/common/linux_file.c
109
res |= cvtto_bsd_mask(lflags, LINUX_O_TRUNC, O_TRUNC);
sys/compat/linux/common/linux_file.c
135
res |= cvtto_linux_mask(bflags, O_TRUNC, LINUX_O_TRUNC);
sys/compat/linux/common/linux_file.c
187
SCARG(&oa, flags) = O_CREAT | O_TRUNC | O_WRONLY;
sys/compat/linux32/common/linux32_unistd.c
533
SCARG(&ua, flags) = O_CREAT | O_TRUNC | O_WRONLY;
sys/compat/netbsd32/netbsd32_compat_43.c
113
SCARG(&ua, flags) = O_WRONLY | O_CREAT | O_TRUNC;
sys/compat/sunos/sunos_misc.c
142
SCARG(&ouap, flags) = O_WRONLY | O_CREAT | O_TRUNC;
sys/compat/sunos32/sunos32_misc.c
219
SCARG(&ua, flags) = O_WRONLY | O_CREAT | O_TRUNC;
sys/compat/ultrix/ultrix_pathname.c
87
SCARG(&ap, flags) = O_WRONLY | O_CREAT | O_TRUNC;
sys/dev/microcode/ral/build.c
38
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/rum/build.c
38
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/run/build.c
38
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/zyd/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/fs/union/union_subr.c
894
int fmode = FFLAGS(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL);
sys/fs/union/union_vnops.c
647
error = union_copyup(un, (mode&O_TRUNC) == 0, cred, l);
sys/fs/unionfs/unionfs_subr.c
610
fmode = FFLAGS(O_WRONLY | O_CREAT | O_TRUNC | O_EXCL);
sys/fs/unionfs/unionfs_vnops.c
482
!(ap->a_mode & O_TRUNC), cred);
sys/kern/kern_veriexec.c
1338
if ((vfe != NULL) && ((fmode & FWRITE) || (fmode & O_TRUNC))) {
sys/kern/vfs_syscalls.c
2210
if (flags & O_TRUNC) {
sys/kern/vfs_vnops.c
277
fmode &= ~O_TRUNC;
sys/kern/vfs_vnops.c
324
if (fmode & O_TRUNC) {
sys/kern/vfs_vnops.c
407
if ((fflags & (FWRITE | O_TRUNC)) != 0) {
sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c
154
flags = sflags & (3 | O_APPEND | O_ASYNC | O_CREAT | O_TRUNC | O_EXCL);
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
202
flags |= (sflags & 0x200) ? O_TRUNC : 0;
sys/sys/fcntl.h
141
O_ASYNC|O_SYNC|O_CREAT|O_TRUNC|O_EXCL|O_DSYNC|\
tests/dev/cgd/t_cgd_3des.c
700
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
tests/dev/cgd/t_cgd_adiantum.c
339
RL(dkfd = open(imgpath, O_CREAT|O_RDWR|O_TRUNC, 0600));
tests/dev/cgd/t_cgd_aes.c
3101
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
tests/dev/cgd/t_cgd_blowfish.c
1936
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
tests/fs/union/t_pr.c
189
fd = rump_sys_open("/mp/null", O_WRONLY | O_CREAT | O_TRUNC, 0600);
tests/fs/vfs/t_io.c
164
RL(fd = rump_sys_open("file", O_RDWR|O_CREAT|O_TRUNC, 0666));
tests/fs/vfs/t_io.c
57
RL(fd = rump_sys_open("file", O_RDWR|O_CREAT|O_TRUNC, 0666));
tests/fs/vfs/t_mtime_otrunc.c
54
int f = rump_sys_open(LOCKFILE, O_WRONLY|O_CREAT|O_TRUNC, 0666);
tests/fs/vfs/t_renamerace.c
51
O_WRONLY|O_CREAT|O_TRUNC, 0666);
tests/kernel/kqueue/t_vnode.c
535
O_RDWR | O_CREAT | O_TRUNC, 0600)) != -1);
tests/kernel/kqueue/t_vnode.c
633
O_RDWR | O_CREAT | O_TRUNC, 0600)) != -1);
tests/kernel/t_lockf.c
130
fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
tests/kernel/t_lockf.c
225
fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
tests/kernel/t_sysv.c
109
output = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
tests/lib/libc/db/h_db.c
129
O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
tests/lib/libc/db/h_lfsr.c
77
db = dbopen(NULL, O_CREAT|O_TRUNC|O_RDWR, 0, DB_HASH, &hi);
tests/lib/libc/db/t_db_hash_seq.c
252
db = state_open(NULL, O_RDWR|O_CREAT|O_TRUNC, 0600);
tests/lib/libc/gen/posix_spawn/t_spawn.c
452
RL(fd = open(FILENAME, O_WRONLY | O_CREAT | O_TRUNC, 0644));
tests/lib/libc/sys/t_getrusage.c
140
fd = open(DUMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0222);
tests/lib/libc/sys/t_syscall.c
71
fd = open(FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/lib/libc/sys/t_syscall.c
96
fd = open(FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/lib/libposix/t_rename.c
57
REQUIRE_LIBC(open("t1", O_CREAT | O_TRUNC | O_WRONLY, 0600), -1);
tests/net/fdpass/fdpass.c
205
fd = open("foo", O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/net/tcp/t_tcp_connect_port.c
112
fd = open(SYSCTLBAKFILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,
usr.bin/at/at.c
253
if ((fdes = open(atfile, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR)) == -1)
usr.bin/audio/record/record.c
224
ti.outfd = open(*argv, O_CREAT|(aflag ? O_APPEND : O_TRUNC)|O_WRONLY, 0666);
usr.bin/bthset/bthset.c
582
fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
usr.bin/cap_mkdb/cap_mkdb.c
137
if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
usr.bin/db/db.c
269
oi.dbflags |= O_TRUNC;
usr.bin/ktrace/ktrace.c
233
(append ? 0 : O_TRUNC) | (synclog ? 0 : O_SYNC),
usr.bin/mail/dotlock.c
85
O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC|O_CLOEXEC, 0);
usr.bin/mail/mime_detach.c
126
flags = (detach_ctl.overwrite ? 0 : O_EXCL) | O_CREAT | O_TRUNC | O_WRONLY;
usr.bin/midirecord/midirecord.c
195
int mode = O_CREAT|(aflag ? O_APPEND : O_TRUNC)|O_WRONLY;
usr.bin/midirecord/midirecord.c
207
int mode = O_CREAT|(aflag ? O_APPEND : O_TRUNC)|O_WRONLY;
usr.bin/mkdep/mkdep.c
233
aflag = O_WRONLY | O_APPEND | O_CREAT | O_TRUNC;
usr.bin/mkdep/mkdep.c
250
aflag &= ~O_TRUNC;
usr.bin/mkdep/mkdep.c
471
aflag & O_TRUNC ? "write" : "append", filename);
usr.bin/mkubootimage/mkubootimage.c
581
image_fd = open(dest, O_WRONLY|O_CREAT|O_TRUNC, 0666);
usr.bin/patch/util.c
175
tofd = open(to, O_CREAT|O_TRUNC|O_WRONLY, 0666);
usr.bin/sed/compile.c
294
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC,
usr.bin/sed/compile.c
770
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC,
usr.bin/sed/process.c
246
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC,
usr.bin/sed/process.c
484
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, DEFFILEMODE)) == -1)
usr.bin/shlock/shlock.c
140
while ((fd = open(tempname, O_RDWR|O_CREAT|O_TRUNC|O_SYNC|O_EXCL, 0644))
usr.bin/split/split.c
367
if ((ofd = open(fname, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE)) < 0)
usr.bin/tee/tee.c
102
O_WRONLY|O_CREAT|O_TRUNC, DEFFILEMODE)) < 0) {
usr.bin/unzip/unzip.c
664
if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0)
usr.bin/vacation/vacation.c
294
db = dbopen(path, O_CREAT|O_RDWR | (iflag ? O_TRUNC : 0),
usr.bin/vndcompress/vndcompress.c
446
oflags = (O_WRONLY | O_TRUNC | O_CREAT);
usr.bin/vndcompress/vnduncompress.c
73
(O_WRONLY | O_CREAT | O_TRUNC), 0777);
usr.bin/xinstall/xinstall.c
754
O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR)) < 0)
usr.bin/xlint/xlint/xlint.c
529
if ((ofd = open(dest, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) {
usr.sbin/acpitools/acpidump/acpi.c
4651
fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, mode);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
912
flags |= O_TRUNC;
usr.sbin/bthcid/config.c
184
fd = open(new_key_file, O_WRONLY|O_TRUNC|O_CREAT|O_EXLOCK, 0600);
usr.sbin/dev_mkdb/dev_mkdb.c
115
db_compat = dbopen(db_name_tmp, O_CREAT|O_EXCL|O_EXLOCK|O_RDWR|O_TRUNC,
usr.sbin/extattrctl/extattrctl.c
108
flags = O_CREAT | O_WRONLY | O_TRUNC | O_EXCL;
usr.sbin/fssconfig/fssconfig.c
168
fd = prog_open(fss.fss_bstore, O_CREAT|O_TRUNC|O_WRONLY, 0600);
usr.sbin/fwctl/fwdv.c
109
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
usr.sbin/fwctl/fwmpegts.c
157
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
usr.sbin/kvm_mkdb/kvm_mkdb.c
163
db = dbopen(dbtemp, O_CREAT | O_EXLOCK | O_TRUNC | O_RDWR,
usr.sbin/lockstat/main.c
259
fd = open(outf, O_WRONLY | O_CREAT | O_TRUNC, 0600);
usr.sbin/lpr/lpd/printjob.c
734
n = open(tempfile, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0664);
usr.sbin/lpr/lpd/printjob.c
899
pfd = open(tempremote, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0664);
usr.sbin/makefs/chfs.c
166
if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) {
usr.sbin/makefs/ffs.c
489
oflags |= O_TRUNC;
usr.sbin/makefs/v7fs.c
115
if ((fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) {
usr.sbin/memswitch/memswitch.c
422
fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0666);
usr.sbin/ndbootd/ndbootd.c
496
if ((fd = open(NDBOOTD_PID_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0644)) >= 0) {
usr.sbin/npf/npfctl/npf_build.c
151
if ((fd = open(outfile, O_CREAT | O_TRUNC | O_WRONLY, 0644)) == -1) {
usr.sbin/pf/pfs/pfs.c
132
wfd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0600);
usr.sbin/sa/pdb.c
183
saved_pacct_db = dbopen(_PATH_SAVACCT, O_RDWR|O_CREAT|O_TRUNC, 0644,
usr.sbin/sa/pdb.c
65
pacct_db = dbopen(NULL, O_RDWR|O_CREAT|O_TRUNC, 0644, DB_BTREE, NULL);
usr.sbin/sa/usrdb.c
200
saved_usracct_db = dbopen(_PATH_USRACCT, O_RDWR|O_CREAT|O_TRUNC, 0644,
usr.sbin/sa/usrdb.c
68
usracct_db = dbopen(NULL, O_RDWR|O_CREAT|O_TRUNC, 0644, DB_BTREE, &bti);
usr.sbin/services_mkdb/output_cdb.c
55
if ((cdbw_fd = open(tname, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) {
usr.sbin/tprof/tprof.c
449
outfd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
usr.sbin/ypbind/ypbind.c
1691
lockfd = open_locked(_PATH_YPBIND_LOCK, O_CREAT|O_RDWR|O_TRUNC, 0644);
usr.sbin/ypbind/ypbind.c
377
fd = open_locked(path, O_CREAT|O_RDWR|O_TRUNC, 0644);
usr.sbin/ypbind/ypbind.c
380
fd = open_locked(path, O_CREAT|O_RDWR|O_TRUNC, 0644);