Lines Matching refs:op
48 _ast_open(const char* path, int op, ...)
57 va_start(ap, op);
58 mode = (op & O_CREAT) ? va_arg(ap, int) : S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
60 if (op & ~(_ast_O_LOCAL-1))
62 if (!(op & O_CREAT))
63 op &= ~O_EXCL;
66 if (op & O_TRUNC)
68 if ((op & O_EXCL) && !access(path, F_OK))
73 if ((fd = creat(path, (op & O_EXCL) ? 0 : mode)) < 0)
75 if (op & O_EXCL)
90 if ((op & O_ACCMODE) == O_RDWR)
93 op &= ~(O_CREAT|O_TRUNC);
97 else if ((fd = open(path, op & (_ast_O_LOCAL-1), mode)) < 0)
99 if (op & O_CREAT)
101 op |= O_TRUNC;
106 else if ((op & O_APPEND) && lseek(fd, 0L, SEEK_END) == -1L)
109 if ((op & O_NOCTTY) && ioctl(fd, TIOCNOTTY, 0))
115 else fd = open(path, op, mode);