?? wrapper.c
字號:
return openx(name, flags, mode, smbw_libc._open);}int __open(char *name, int flags, mode_t mode){ check_init("open"); return openx(name, flags, mode, smbw_libc.__open);}int open64 (__const char *name, int flags, ...){ va_list ap; mode_t mode; va_start(ap, flags); mode = va_arg(ap, mode_t); va_end(ap); check_init("open64"); return openx((char *) name, flags, mode, smbw_libc.open64);}int _open64(char *name, int flags, mode_t mode){ check_init("_open64"); return openx(name, flags, mode, smbw_libc._open64);}int __open64(char *name, int flags, mode_t mode){ check_init("__open64"); return openx(name, flags, mode, smbw_libc.__open64);}ssize_t pread(int fd, void *buf, size_t size, off_t ofs){ check_init("pread"); if (smbw_fd(fd)) { return smbw_pread(fd, buf, size, ofs); } return (* smbw_libc.pread)(fd, buf, size, ofs);}ssize_t pread64(int fd, void *buf, size_t size, off64_t ofs){ check_init("pread64"); if (smbw_fd(fd)) { return smbw_pread(fd, buf, size, (off_t) ofs); } return (* smbw_libc.pread64)(fd, buf, size, ofs);}ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs){ check_init("pwrite"); if (smbw_fd(fd)) { return smbw_pwrite(fd, (void *) buf, size, ofs); } return (* smbw_libc.pwrite)(fd, (void *) buf, size, ofs);}ssize_t pwrite64(int fd, const void *buf, size_t size, off64_t ofs){ check_init("pwrite64"); if (smbw_fd(fd)) { return smbw_pwrite(fd, (void *) buf, size, (off_t) ofs); } return (* smbw_libc.pwrite64)(fd, (void *) buf, size, ofs);}int chdir(const char *name){ check_init("chdir"); return smbw_chdir((char *) name);;}int __chdir(char *name){ check_init("__chdir"); return smbw_chdir(name);}int _chdir(char *name){ check_init("_chdir"); return smbw_chdir(name);}int close(int fd){ check_init("close"); return closex(fd, smbw_libc.close);}int __close(int fd){ check_init("__close"); return closex(fd, smbw_libc.__close);}int _close(int fd){ check_init("_close"); return closex(fd, smbw_libc._close);}int fchdir(int fd){ check_init("fchdir"); return smbw_fchdir(fd);}int __fchdir(int fd){ check_init("__fchdir"); return fchdir(fd);}int _fchdir(int fd){ check_init("_fchdir"); return fchdir(fd);}int fcntl (int fd, int cmd, ...){ va_list ap; long arg; va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap); check_init("fcntl"); return fcntlx(fd, cmd, arg, smbw_libc.fcntl);}int __fcntl(int fd, int cmd, ...){ va_list ap; long arg; va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap); check_init("__fcntl"); return fcntlx(fd, cmd, arg, smbw_libc.__fcntl);}int _fcntl(int fd, int cmd, ...){ va_list ap; long arg; va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap); check_init("_fcntl"); return fcntlx(fd, cmd, arg, smbw_libc._fcntl);}int getdents(int fd, struct dirent *dirp, unsigned int count){ check_init("getdents"); return getdentsx(fd, dirp, count, smbw_libc.getdents);}int __getdents(int fd, struct dirent *dirp, unsigned int count){ check_init("__getdents"); return getdentsx(fd, dirp, count, smbw_libc.__getdents);}int _getdents(int fd, struct dirent *dirp, unsigned int count){ check_init("_getdents"); return getdentsx(fd, dirp, count, smbw_libc._getdents);}int getdents64(int fd, struct dirent64 *external, unsigned int count){ check_init("getdents64"); if (smbw_fd(fd)) { int i; struct SMBW_dirent *internal; int ret; int n; /* * LIMITATION: If they pass a count which is not a multiple of * the size of struct dirent, they will not get a partial * structure; we ignore the excess count. */ n = (count / sizeof(struct dirent64)); internal = malloc(sizeof(struct SMBW_dirent) * n); if (internal == NULL) { errno = ENOMEM; return -1; } ret = smbw_getdents(fd, internal, count); if (ret <= 0) return ret; ret = sizeof(struct dirent) * count; for (i = 0; count; i++, count--) dirent64_convert(&internal[i], &external[i]); return ret; } return (* smbw_libc.getdents64)(fd, external, count);}off_t lseek(int fd, off_t offset, int whence){ off_t ret; check_init("lseek"); ret = lseekx(fd, offset, whence, smbw_libc.lseek); if (smbw_debug) { printf("lseek(%d, 0x%llx) returned 0x%llx\n", fd, (unsigned long long) offset, (unsigned long long) ret); } return ret;}off_t __lseek(int fd, off_t offset, int whence){ off_t ret; check_init("__lseek"); ret = lseekx(fd, offset, whence, smbw_libc.__lseek); if (smbw_debug) { printf("__lseek(%d, 0x%llx) returned 0x%llx\n", fd, (unsigned long long) offset, (unsigned long long) ret); } return ret;}off_t _lseek(int fd, off_t offset, int whence){ off_t ret; check_init("_lseek"); ret = lseekx(fd, offset, whence, smbw_libc._lseek); if (smbw_debug) { printf("_lseek(%d, 0x%llx) returned 0x%llx\n", fd, (unsigned long long) offset, (unsigned long long) ret); } return ret;}off64_t lseek64(int fd, off64_t offset, int whence){ off64_t ret; check_init("lseek64"); ret = lseek64x(fd, offset, whence, smbw_libc.lseek64); if (smbw_debug) { printf("lseek64(%d, 0x%llx) returned 0x%llx\n", fd, (unsigned long long) offset, (unsigned long long) ret); } return ret;}off64_t __lseek64(int fd, off64_t offset, int whence){ check_init("__lseek64"); return lseek64x(fd, offset, whence, smbw_libc.__lseek64);}off64_t _lseek64(int fd, off64_t offset, int whence){ off64_t ret; check_init("_lseek64"); ret = lseek64x(fd, offset, whence, smbw_libc._lseek64); if (smbw_debug) { printf("_lseek64(%d, 0x%llx) returned 0x%llx\n", fd, (unsigned long long) offset, (unsigned long long) ret); } return ret;}ssize_t read(int fd, void *buf, size_t count){ check_init("read"); return readx(fd, buf, count, smbw_libc.read);}ssize_t __read(int fd, void *buf, size_t count){ check_init("__read"); return readx(fd, buf, count, smbw_libc.__read);}ssize_t _read(int fd, void *buf, size_t count){ check_init("_read"); return readx(fd, buf, count, smbw_libc._read);}ssize_t write(int fd, const void *buf, size_t count){ check_init("write"); return writex(fd, (void *) buf, count, smbw_libc.write);}ssize_t __write(int fd, const void *buf, size_t count){ check_init("__write"); return writex(fd, (void *) buf, count, smbw_libc.__write);}ssize_t _write(int fd, const void *buf, size_t count){ check_init("_write"); return writex(fd, (void *) buf, count, smbw_libc._write);}int access(const char *name, int mode){ check_init("access"); if (smbw_path((char *) name)) { return smbw_access((char *) name, mode); } return (* smbw_libc.access)((char *) name, mode);}int chmod(const char *name, mode_t mode){ check_init("chmod"); if (smbw_path((char *) name)) { return smbw_chmod((char *) name, mode); } return (* smbw_libc.chmod)((char *) name, mode);}int fchmod(int fd, mode_t mode){ check_init("fchmod"); if (smbw_fd(fd)) { /* Not yet implemented in libsmbclient */ return ENOTSUP; } return (* smbw_libc.fchmod)(fd, mode);}int chown(const char *name, uid_t owner, gid_t group){ check_init("chown"); if (smbw_path((char *) name)) { return smbw_chown((char *) name, owner, group); } return (* smbw_libc.chown)((char *) name, owner, group);}int fchown(int fd, uid_t owner, gid_t group){ check_init("fchown"); if (smbw_fd(fd)) { /* Not yet implemented in libsmbclient */ return ENOTSUP; } return (* smbw_libc.fchown)(fd, owner, group);}char *getcwd(char *buf, size_t size){ check_init("getcwd"); return (char *)smbw_getcwd(buf, size);}int mkdir(const char *name, mode_t mode){ check_init("mkdir"); if (smbw_path((char *) name)) { return smbw_mkdir((char *) name, mode); } return (* smbw_libc.mkdir)((char *) name, mode);}int __fxstat(int vers, int fd, struct stat *st){ check_init("__fxstat"); if (smbw_fd(fd)) { struct SMBW_stat statbuf; int ret = smbw_fstat(fd, &statbuf); stat_convert(&statbuf, st); return ret; } return (* smbw_libc.__fxstat)(vers, fd, st);}int __xstat(int vers, const char *name, struct stat *st){ check_init("__xstat"); if (smbw_path((char *) name)) { struct SMBW_stat statbuf; int ret = smbw_stat((char *) name, &statbuf); stat_convert(&statbuf, st); return ret; } return (* smbw_libc.__xstat)(vers, (char *) name, st);}int __lxstat(int vers, const char *name, struct stat *st){ check_init("__lxstat"); if (smbw_path((char *) name)) { struct SMBW_stat statbuf; int ret = smbw_stat((char *) name, &statbuf); stat_convert(&statbuf, st); return ret; } return (* smbw_libc.__lxstat)(vers, (char *) name, st);}int stat(const char *name, struct stat *st){ check_init("stat"); if (smbw_path((char *) name)) { struct SMBW_stat statbuf; int ret = smbw_stat((char *) name, &statbuf); stat_convert(&statbuf, st); return ret; } return (* smbw_libc.stat)((char *) name, st);}int lstat(const char *name, struct stat *st){ check_init("lstat"); if (smbw_path((char *) name)) { struct SMBW_stat statbuf; int ret = smbw_stat((char *) name, &statbuf); stat_convert(&statbuf, st); return ret; } return (* smbw_libc.lstat)((char *) name, st);}int fstat(int fd, struct stat *st){ check_init("fstat"); if (smbw_fd(fd)) { struct SMBW_stat statbuf; int ret = smbw_fstat(fd, &statbuf); stat_convert(&statbuf, st); return ret; } return (* smbw_libc.fstat)(fd, st);}int unlink(const char *name){ check_init("unlink"); if (smbw_path((char *) name)) { return smbw_unlink((char *) name); } return (* smbw_libc.unlink)((char *) name);}int utime(const char *name, const struct utimbuf *tvp){ check_init("utime"); if (smbw_path(name)) { return smbw_utime(name, (struct utimbuf *) tvp); } return (* smbw_libc.utime)((char *) name, (struct utimbuf *) tvp);}int utimes(const char *name, const struct timeval *tvp){ check_init("utimes"); if (smbw_path(name)) { return smbw_utimes(name, (struct timeval *) tvp); } return (* smbw_libc.utimes)((char *) name, (struct timeval *) tvp);}int readlink(const char *path, char *buf, size_t bufsize){ check_init("readlink"); if (smbw_path((char *) path)) { return smbw_readlink(path, (char *) buf, bufsize); } return (* smbw_libc.readlink)((char *) path, buf, bufsize);}int rename(const char *oldname, const char *newname){ int p1, p2; check_init("rename"); p1 = smbw_path((char *) oldname); p2 = smbw_path((char *) newname); if (p1 ^ p2) { /* can't cross filesystem boundaries */ errno = EXDEV; return -1; } if (p1 && p2) { return smbw_rename((char *) oldname, (char *) newname); } return (* smbw_libc.rename)((char *) oldname, (char *) newname);}int rmdir(const char *name){ check_init("rmdir"); if (smbw_path((char *) name)) { return smbw_rmdir((char *) name); } return (* smbw_libc.rmdir)((char *) name);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -