int open64(const char *pathname, int flags, ...) { int rwflag = flags & 3; DBG("pathname=%s, flags=%d\n", pathname, flags); if (O_WRONLY == rwflag || O_RDWR == rwflag) { if (check_perm(pathname, RESTRICTED_ALLOW_OPEN_WRITE_ENV, &patterns_open_write)) return -1; } if (O_RDONLY == rwflag) { if (check_perm(pathname, RESTRICTED_ALLOW_OPEN_READ_ENV, &patterns_open_read)) return -1; } if (O_CREAT == (flags & O_CREAT)) { va_list ap; mode_t mode; va_start(ap, flags); mode = va_arg(ap, mode_t); va_end(ap); return real_open64(pathname, flags, mode); } else return real_open64(pathname, flags); }
int open64(const char *pathname, int flags, mode_t mode) { static int (*real_open64)(const char *pathname, int flags, mode_t mode) = NULL; const char *p; int ret; GET_PATH(open64); if (p) { ret = real_open64(p, flags, mode); PUT_PATH(-1); } return real_open64(pathname, flags, mode); }
int open64(const char *pathname, int flags, mode_t mode) { int ret; DBG("enter: filename=%s\n", pathname); ret = real_open64(pathname, flags, mode); if (unlikely(-1 == ret) && !(flags & O_WRONLY)) { if (-1 == install_package_for(pathname)) return -1; else return real_open64(pathname, flags, mode); } return ret; }
static int real_open(const char *path, int flags, mode_t mode, int undersc, int is64, int creat) { int res; is64 = is64; /* Possibly unused arg */ if(creat) { #ifdef HAVE_CREAT64 if(is64) res = real_creat64(path, mode, undersc); else #endif res = real_creat32(path, mode, undersc); } else { #ifdef HAVE_OPEN64 if(is64) res = real_open64(path, flags, mode, undersc); else #endif res = real_open32(path, flags, mode, undersc); } return res; }
int open64(char *name, int flags, mode_t mode) { if (smbw_path(name)) { return smbw_open(name, flags, mode); } return real_open64(name, flags, mode); }
int open64 (const char *file, int flags, mode_t mode) { if (0 == strcmp ("/dev/null", file)) return dup (fdnull); if (0 == strcmp ("/dev/zero", file)) return dup (fdzero); return real_open64 (file, flags, mode); }
int open64(const char *pathname, int flags) { int fd; printf("Open64\n"); printf("%s", pathname); fd = real_open64(pathname, flags); printf("am back"); return fd; /*check if for transactional file system)*/ /*check if can be locked*/ /*call original syscall*/ /*If successful assign permanent lock*/ }