O_TRUNC
ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666);
outfd = open(outfile, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
if ((out_fd = open(argv[2], (O_RDWR | O_CREAT | O_TRUNC), 0666)) < 0) {
f |= O_TRUNC;
struct file *file = filp_open(path, O_RDWR | O_CREAT | O_TRUNC, 0600);
int flags = O_RDWR | O_CREAT | O_TRUNC;
if (uflags & O_TRUNC)
if (file->f_flags & O_TRUNC)
if (flags & (O_WRONLY|O_RDWR|O_CREAT|O_TRUNC))
ceph_sys2wire(O_TRUNC);
flags &= ~O_TRUNC;
if (flags & O_TRUNC)
bool trunc = flags & O_TRUNC;
flags &= ~(O_CREAT | O_EXCL | O_TRUNC);
bool is_truncate = (file->f_flags & O_TRUNC) && fc->atomic_o_trunc;
inarg.flags &= ~O_TRUNC;
(inarg.flags & O_TRUNC) && !capable(CAP_FSETID)) {
flag &= ~O_TRUNC;
if (flag & O_TRUNC)
open_flag &= ~O_TRUNC;
open_flag &= ~O_TRUNC;
if (open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) {
open_flag &= ~O_TRUNC;
} else if (d_is_reg(nd->path.dentry) && open_flag & O_TRUNC) {
if (open_flags & O_TRUNC) {
if (open_flags & O_TRUNC) {
if (openflags & O_TRUNC) {
if (open_mode & (O_EXCL|O_TRUNC))
(file->f_flags & (O_WRONLY | O_RDWR | O_TRUNC))) {
if (flags & O_TRUNC)
if (flags & (O_TRUNC | O_CREAT | __O_TMPFILE))
int flags = O_CREAT | O_WRONLY | O_TRUNC;
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
if (flags && ((OPEN_FMODE(flags) & FMODE_WRITE) || (flags & O_TRUNC)))
if (flags & O_TRUNC)
file->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
return ((OPEN_FMODE(flags) & FMODE_WRITE) || (flags & O_TRUNC));
else if ((oflags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
if (file->f_flags & O_TRUNC) {
~(O_CREAT | O_EXCL | O_TRUNC);
oflags &= ~(O_CREAT | O_EXCL | O_TRUNC);
cflags &= ~(O_CREAT | O_EXCL | O_TRUNC);
if (flags & O_TRUNC)
else if ((flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
else if ((flags & O_TRUNC) == O_TRUNC)
oflags |= O_TRUNC;
if (open_flags & (O_CREAT | O_TRUNC)) {
if (!(open_flags & O_TRUNC))
if (!S_ISDIR(file_inode(filp)->i_mode) && open_flags & O_TRUNC &&
if (file->f_flags & O_TRUNC)
if (file->f_flags & O_TRUNC)
if ((!(permflag & O_APPEND) || (permflag & O_TRUNC)) &&
(O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC | \
{ O_TRUNC, "O_TRUNC" }, \
#ifndef O_TRUNC
openflags |= O_TRUNC;
return open->how.flags & (O_TRUNC | O_CREAT | __O_TMPFILE);
int ret = (flags & O_TRUNC);
if (file->f_flags & O_TRUNC) {
if (file->f_flags & O_TRUNC)
(file->f_flags & O_TRUNC))
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC))
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC))
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
(file->f_flags & O_TRUNC))
(file->f_flags & O_TRUNC))
(file->f_flags & O_TRUNC))
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
(file->f_flags & O_TRUNC)) {
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
{ O_TRUNC, "O_TRUNC" },
"{ 0x%x, \"O_TRUNC\" }, ", O_TRUNC);
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
kfd = open(buf, O_WRONLY | O_TRUNC, 0);
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
fd = open(depfile_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
fd_map = open(tmp_file, O_WRONLY | O_TRUNC | O_CREAT, sb.st_mode);
if (flags & O_TRUNC)
O_TRUNC | O_CREAT | O_NOCTTY | O_EXCL);
fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC,
fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
ofd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE);
fd = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
outfd = open(argv[optind+1], O_TRUNC|O_CREAT|O_WRONLY, 0644);
O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
flags = O_WRONLY | O_CREAT | O_TRUNC;
linker->fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
dst_fd = open(dst, O_WRONLY | O_CREAT | O_TRUNC, 0400);
fd = open("output", O_RDWR|O_CREAT|O_TRUNC, 0644);
fd = open(SESSION_OUTPUT, O_RDWR|O_CREAT|O_TRUNC, 0644);
flags |= O_TRUNC;
fd = open(dump_path, O_CREAT|O_TRUNC|O_RDWR, 0666);
fd = open(output_name, O_CREAT | O_WRONLY | (opts->force ? O_TRUNC : O_EXCL), 0666);
int fd = open(data->file.path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, S_IRUSR|S_IWUSR);
ret = open(file->path, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR);
fd = open(filename, O_CREAT|O_TRUNC|O_WRONLY, 0644);
out_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
ctx.fd = open("/proc/self/comm", O_WRONLY|O_TRUNC);
comm_fd = open("/proc/self/comm", O_WRONLY|O_TRUNC);
fd = open("/proc/self/comm", O_WRONLY|O_TRUNC);
fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666);
int out_fd = open(dest, O_RDWR|O_CREAT|O_TRUNC, 0755);
fd = open("subdir.ephemeral/script", O_RDWR|O_CREAT|O_TRUNC, 0755);
ret = openat(dfd, "regfile", O_CREAT | O_WRONLY | O_TRUNC, 0644);
fd1 = open(kpath, O_RDWR | O_CREAT | O_TRUNC, 0644);
fd = openat(curr, "file.txt", O_CREAT | O_TRUNC | O_WRONLY,
dst_fd = open(dst_path, O_WRONLY | O_TRUNC | O_CLOEXEC);
EXPECT_EQ(0, test_open(file_r, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_r, O_WRONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_w, O_RDONLY | O_TRUNC));
EXPECT_EQ(0, test_open(file_w, O_WRONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_none, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_none, O_WRONLY | O_TRUNC));
EXPECT_EQ(0, test_open(file_rwt, O_RDONLY | O_TRUNC));
EXPECT_EQ(0, test_open(file_rwt, O_WRONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_rw, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_rw, O_WRONLY | O_TRUNC));
EXPECT_EQ(0, test_open(file_rt, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_rt, O_WRONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_t, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_t, O_WRONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_none, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_none, O_WRONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_in_dir_t, O_RDONLY | O_TRUNC));
EXPECT_EQ(EACCES, test_open(file_in_dir_t, O_WRONLY | O_TRUNC));
O_RDWR | O_CREAT | O_TRUNC,
O_RDWR | O_CREAT | O_TRUNC,
fd = open(finfo.path, O_DSYNC | O_CREAT | O_RDWR | O_TRUNC | O_EXCL,
fd = open_by_handle_at(FD_NSFS_ROOT, handle, O_TRUNC);
{ O_TRUNC, "O_TRUNC" },
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
fd = open(path, O_WRONLY | O_TRUNC);
fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU);
fd = open("/tmp/vringh_test-file", O_RDWR|O_CREAT|O_TRUNC, 0600);
O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC,