if (!no_process_group) setsid();
#elif defined(TIOCNOTTY)
if (!no_process_group) {
- int i = sys_open("/dev/tty", O_RDWR, 0);
+ int i = open("/dev/tty", O_RDWR, 0);
if (i != -1) {
ioctl(i, (int) TIOCNOTTY, (char *)0);
close(i);
handle = fileno(stdout);
} else {
if (reget) {
- handle = sys_open(lname, O_WRONLY|O_CREAT, 0644);
+ handle = open(lname, O_WRONLY|O_CREAT, 0644);
if (handle >= 0) {
start = lseek(handle, 0, SEEK_END);
if (start == -1) {
}
}
} else {
- handle = sys_open(lname, O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ handle = open(lname, O_WRONLY|O_CREAT|O_TRUNC, 0644);
}
newhandle = true;
}
bool fake_dir_create_times);
int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len);
-int sys_open(const char *path, int oflag, mode_t mode);
FILE *sys_fopen(const char *path, const char *type);
void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
SMB_STRUCT_DIR *sys_opendir(const char *name);
SAFE_FREE(name);
- fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
+ fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
if (fd == -1) {
SAFE_FREE(pidFile);
return 0;
exit(1);
}
- fd = sys_open(pidFile_name, O_NONBLOCK | O_CREAT | O_WRONLY | O_EXCL,
+ fd = open(pidFile_name, O_NONBLOCK | O_CREAT | O_WRONLY | O_EXCL,
0644);
if (fd == -1) {
DEBUG(0,("ERROR: can't open %s: Error was %s\n", pidFile_name,
sscanf(p, "%d", &fd);
close_it = false;
} else if ((p = getenv("PASSWD_FILE")) != NULL) {
- fd = sys_open(p, O_RDONLY, 0);
+ fd = open(p, O_RDONLY, 0);
spec = SMB_STRDUP(p);
if (fd < 0) {
fprintf(stderr, "Error opening PASSWD_FILE %s: %s\n",
#endif
}
-/*******************************************************************
- An open() wrapper.
-********************************************************************/
-
-int sys_open(const char *path, int oflag, mode_t mode)
-{
- return open(path, oflag, mode);
-}
-
/*******************************************************************
An fopen() wrapper.
********************************************************************/
goto out;
}
- if ((fd = sys_open(unix_path, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) {
+ if ((fd = open(unix_path, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) {
result = map_nt_error_from_unix(errno);
goto out;
}
return -1;
}
- if((ifd = sys_open (source, O_RDONLY, 0)) < 0)
+ if((ifd = open (source, O_RDONLY, 0)) < 0)
return -1;
if (unlink (dest) && errno != ENOENT)
return -1;
#ifdef O_NOFOLLOW
- if((ofd = sys_open (dest, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, 0600)) < 0 )
+ if((ofd = open (dest, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, 0600)) < 0 )
#else
- if((ofd = sys_open (dest, O_WRONLY | O_CREAT | O_TRUNC , 0600)) < 0 )
+ if((ofd = open (dest, O_WRONLY | O_CREAT | O_TRUNC , 0600)) < 0 )
#endif
goto err;
goto out;
}
- result = sys_open(smb_fname->base_name, flags, mode);
+ result = open(smb_fname->base_name, flags, mode);
out:
END_PROFILE(syscall_open);
return result;
/* Try and open the file read only - no symlinks allowed. */
#ifdef O_NOFOLLOW
- fd = sys_open(fname, O_RDONLY|O_NOFOLLOW, 0);
+ fd = open(fname, O_RDONLY|O_NOFOLLOW, 0);
#else
- fd = sys_open(fname, O_RDONLY, 0);
+ fd = open(fname, O_RDONLY, 0);
#endif
if (fd == -1) {
int i, fd = -1;
for(i = 0; i < 5; i++) {
- if((fd = sys_open(pfile, O_CREAT|O_TRUNC|O_EXCL|O_RDWR, 0600))!=-1) {
+ if((fd = open(pfile, O_CREAT|O_TRUNC|O_EXCL|O_RDWR, 0600))!=-1) {
break;
}
usleep(200); /* Spin, spin... */
#if defined(HAVE_GRANTPT)
/* Try to open /dev/ptmx. If that fails, fall through to old method. */
- if ((master = sys_open("/dev/ptmx", O_RDWR, 0)) >= 0) {
+ if ((master = open("/dev/ptmx", O_RDWR, 0)) >= 0) {
grantpt(master);
unlockpt(master);
line = (char *)ptsname(master);
line));
line[8] = dpname[3];
line[9] = dpname[4];
- if ((master = sys_open(line, O_RDWR, 0)) >= 0) {
+ if ((master = open(line, O_RDWR, 0)) >= 0) {
DEBUG(3, ("pty: opened %s\n", line));
line[5] = 't';
*slave = line;
}
/* Open slave pty and acquire as new controlling terminal. */
- if ((slave = sys_open(slavedev, O_RDWR, 0)) < 0)
+ if ((slave = open(slavedev, O_RDWR, 0)) < 0)
{
DEBUG(3, ("More weirdness, could not open %s\n", slavedev));
return (False);
return False;
}
- if((fd = sys_open(tmpname, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600)) < 0) {
+ if((fd = open(tmpname, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600)) < 0) {
DEBUG(0,("check_kernel_oplocks: Unable to open temp test file "
"%s. Error was %s\n",
tmpname, strerror(errno) ));
}
DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name));
- if((file=sys_open(name, O_RDONLY,0))<0) {
+ if((file=open(name, O_RDONLY,0))<0) {
unbecome_root();
return false;
}
set_effective_uid(0);
DEBUG(5,("disk_quotas: looking for VxFS quotas file \"%s\"\n", qfname));
- if((file=sys_open(qfname, O_RDONLY,0))<0) {
+ if((file=open(qfname, O_RDONLY,0))<0) {
set_effective_uid(euser_id);
return(False);
}
}
#ifdef O_NOFOLLOW
- fd = sys_open(basepath, O_RDONLY|O_NOFOLLOW, 0);
+ fd = open(basepath, O_RDONLY|O_NOFOLLOW, 0);
#else
- fd = sys_open(basepath, O_RDONLY, 0);
+ fd = open(basepath, O_RDONLY, 0);
#endif
if (fd == -1) {
int fd;
if (lang) {
if (asprintf(&p, "lang/%s/%s", lang, fname) != -1) {
- fd = sys_open(p, flags, mode);
+ fd = open(p, flags, mode);
free(p);
if (fd != -1) {
return fd;
}
/* fall through to default name */
- return sys_open(fname, flags, mode);
+ return open(fname, flags, mode);
}