Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 572) sorted by relevance

12345678910>>...23

/haiku/headers/build/
H A DBeOSBuildCompatibility.h49 extern ssize_t read_pos(int fd, off_t pos, void* buffer, size_t count);
50 extern ssize_t write_pos(int fd, off_t pos, const void* buffer, size_t count);
85 int _haiku_build_fchmod(int fd, mode_t mode);
86 int _haiku_build_fchmodat(int fd, const char* path, mode_t mode, int flag);
87 int _haiku_build_fstat(int fd, struct stat* st);
88 int _haiku_build_fstatat(int fd, const char* path, struct stat* st,
90 int _haiku_build_mkdirat(int fd, const char* path, mode_t mode);
91 int _haiku_build_mkfifoat(int fd, const char* path, mode_t mode);
92 int _haiku_build_utimensat(int fd, const char* path,
94 int _haiku_build_futimens(int fd, const struct timespec times[2]);
[all …]
/haiku/src/build/libroot/
H A Dfunction_remapper.cpp16 fchmod(int fd, mode_t mode) in fchmod() argument
20 return _haiku_build_fchmod(fd, mode); in fchmod()
25 fchmodat(int fd, const char* path, mode_t mode, int flag) in fchmodat() argument
29 return _haiku_build_fchmodat(fd, path, mode, flag); in fchmodat()
34 fstat(int fd, struct stat* st) in fstat() argument
38 return _haiku_build_fstat(fd, st); in fstat()
43 fstatat(int fd, const char* path, struct stat* st, int flag) in fstatat() argument
47 return _haiku_build_fstatat(fd, path, st, flag); in fstatat()
52 mkdirat(int fd, const char* path, mode_t mode) in mkdirat() argument
56 return _haiku_build_mkdirat(fd, path, mode); in mkdirat()
[all …]
H A Dremapped_functions.h13 int _haiku_build_fchmod(int fd, mode_t mode);
14 int _haiku_build_fchmodat(int fd, const char* path, mode_t mode, int flag);
15 int _haiku_build_fstat(int fd, struct stat* st);
16 int _haiku_build_fstatat(int fd, const char* path, struct stat* st,
18 int _haiku_build_mkdirat(int fd, const char* path, mode_t mode);
19 int _haiku_build_mkfifoat(int fd, const char* path, mode_t mode);
20 int _haiku_build_utimensat(int fd, const char* path,
22 int _haiku_build_futimens(int fd, const struct timespec times[2]);
23 int _haiku_build_faccessat(int fd, const char* path, int accessMode,
25 int _haiku_build_fchdir(int fd);
[all …]
H A Dfs_freebsd.cpp25 haiku_freebsd_read(int fd, void *buf, size_t nbytes) in haiku_freebsd_read() argument
28 if (fstat(fd, &st) != 0) in haiku_freebsd_read()
32 return read(fd, buf, nbytes); // Is a file! Good :) in haiku_freebsd_read()
35 if (ioctl(fd, DIOCGSECTORSIZE, &sectorSize) == -1) in haiku_freebsd_read()
38 off_t cur = lseek(fd, 0, SEEK_CUR); in haiku_freebsd_read()
47 return read(fd, buf, nbytes); in haiku_freebsd_read()
53 off_t sdCur = lseek(fd, -(cur % sectorSize), SEEK_CUR); in haiku_freebsd_read()
57 if (read(fd, tmpBlock, sectorSize) == -1) in haiku_freebsd_read()
63 if (lseek(fd, -sectorSize + (cur % sectorSize) + nbytes, SEEK_CUR) in haiku_freebsd_read()
79 if (lseek(fd, -(sectorSize - seekDiff), SEEK_CUR) == -1) in haiku_freebsd_read()
[all …]
H A Dfs.cpp129 FDFile(int fd) in FDFile()
131 fFD(fd) in FDFile()
151 futimens(int fd, const struct timespec times[2]) in futimens() argument
153 FDFile file(fd); in futimens()
162 FDPathFile(int fd, const char* path, int flag) in FDPathFile()
164 fFD(fd), in FDPathFile()
189 utimensat(int fd, const char* path, const struct timespec times[2], int flag) in utimensat() argument
191 FDPathFile file(fd, path, flag); in utimensat()
401 BPrivate::get_path(int fd, const char *name, string &path) in get_path() argument
404 if (fd >= 0 && !(name && name[0] == '/')) { in get_path()
[all …]
H A Dfs_darwin.cpp20 static int get_path(int fd, const char* path, char fullPath[]);
25 get_path(int fd, const char* path, char fullPath[]) in get_path() argument
28 if (fstat(fd, &dirst) < 0) { in get_path()
39 if (fcntl(fd, F_GETPATH, fullPath) < 0) { in get_path()
110 faccessat(int fd, const char* path, int accessMode, int flag) in faccessat() argument
118 if (fd == AT_FDCWD || (path != NULL && path[0] == '/')) { in faccessat()
124 if (fd < 0) { in faccessat()
131 if (get_path(fd, path, fullPath) < 0) in faccessat()
140 fchmodat(int fd, const char* path, mode_t mode, int flag) in fchmodat() argument
148 if (fd == AT_FDCWD || (path != NULL && path[0] == '/')) { in fchmodat()
[all …]
H A Dfs_attr_haiku.cpp69 _haiku_build_fs_fopen_attr_dir(int fd) in _haiku_build_fs_fopen_attr_dir() argument
72 status_t error = localFD.Init(fd); in _haiku_build_fs_fopen_attr_dir()
108 _haiku_build_fs_fopen_attr(int fd, const char *attribute, uint32 type, int openMode) in _haiku_build_fs_fopen_attr() argument
110 if (fd < 0) { in _haiku_build_fs_fopen_attr()
116 status_t error = localFD.Init(fd); in _haiku_build_fs_fopen_attr()
132 _haiku_build_fs_close_attr(int fd) in _haiku_build_fs_close_attr() argument
134 return fs_close_attr(fd); in _haiku_build_fs_close_attr()
139 _haiku_build_fs_read_attr(int fd, const char* attribute, uint32 type, off_t pos, in _haiku_build_fs_read_attr() argument
143 status_t error = localFD.Init(fd); in _haiku_build_fs_read_attr()
151 int fd = open(localFD.Path(), O_RDONLY | O_NOTRAVERSE); in _haiku_build_fs_read_attr() local
[all …]
H A Dfs_attr_xattr.h21 list_attributes(int fd, const char* path, char* buffer, size_t bufferSize) in list_attributes() argument
23 if (fd >= 0) in list_attributes()
24 return flistxattr(fd, buffer, bufferSize); in list_attributes()
30 get_attribute(int fd, const char* path, const char* attribute, void* buffer, in get_attribute() argument
33 if (fd >= 0) in get_attribute()
34 return fgetxattr(fd, attribute, buffer, bufferSize); in get_attribute()
40 set_attribute(int fd, const char* path, const char* attribute, in set_attribute() argument
43 if (fd >= 0) in set_attribute()
44 return fsetxattr(fd, attribute, buffer, bufferSize, 0); in set_attribute()
50 remove_attribute(int fd, const char* path, const char* attribute) in remove_attribute() argument
[all …]
H A Dfs_attr_bsdxattr.h21 list_attributes(int fd, const char* path, char* buffer, size_t bufferSize) in list_attributes() argument
23 if (fd >= 0) in list_attributes()
24 return flistxattr(fd, buffer, bufferSize, 0); in list_attributes()
30 get_attribute(int fd, const char* path, const char* attribute, void* buffer, in get_attribute() argument
33 if (fd >= 0) in get_attribute()
34 return fgetxattr(fd, attribute, buffer, bufferSize, 0, 0); in get_attribute()
40 set_attribute(int fd, const char* path, const char* attribute, in set_attribute() argument
43 if (fd >= 0) in set_attribute()
44 return fsetxattr(fd, attribute, buffer, bufferSize, 0, 0); in set_attribute()
50 remove_attribute(int fd, const char* path, const char* attribute) in remove_attribute() argument
[all …]
/haiku/src/tests/system/kernel/
H A Dselect_check.cpp26 for (int fd = 0; fd < 3; fd++) { in main() local
27 if (strchr(config[fd], 'r')) in main()
28 FD_SET(fd, &readSet); in main()
29 if (strchr(config[fd], 'w')) in main()
30 FD_SET(fd, &writeSet); in main()
31 if (strchr(config[fd], 'e')) in main()
32 FD_SET(fd, &errorSet); in main()
38 for (int fd = 0; fd < 3; fd++) { in main() local
39 fprintf(stderr, "fd %d: %s%s%s\n", fd, in main()
40 FD_ISSET(fd, &readSet) ? "r" : " ", in main()
[all …]
/haiku/src/tools/fs_shell/
H A Dunistd.cpp48 extern "C" ssize_t _kern_read(int fd, off_t pos, void *buffer, size_t bufferSize);
49 extern "C" ssize_t _kern_write(int fd, off_t pos, const void *buffer, size_t bufferSize);
50 extern "C" int _kern_dup(int fd);
51 extern "C" status_t _kern_close(int fd);
58 test_size(int fd, off_t size) in test_size() argument
65 if (lseek(fd, size - 1, SEEK_SET) < 0) in test_size()
68 return (read(fd, &buffer, 1) == 1); in test_size()
73 get_partition_size(int fd, off_t maxSize) in get_partition_size() argument
80 if (test_size(fd, mid)) in get_partition_size()
93 fssh_dup(int fd) in fssh_dup() argument
[all …]
H A Dsyscalls.h33 int _kern_open(int fd, const char *path, int openMode, int perms);
36 int _kern_open_dir(int fd, const char *path);
37 fssh_status_t _kern_fcntl(int fd, int op, uint32_t argument);
38 fssh_status_t _kern_fsync(int fd);
39 fssh_status_t _kern_lock_node(int fd);
40 fssh_status_t _kern_unlock_node(int fd);
43 fssh_status_t _kern_create_dir(int fd, const char *path, int perms);
44 fssh_status_t _kern_remove_dir(int fd, const char *path);
45 fssh_status_t _kern_read_link(int fd, const char *path, char *buffer,
47 fssh_status_t _kern_create_symlink(int fd, const char *path,
[all …]
H A Duio.cpp25 extern "C" ssize_t _kern_readv(int fd, off_t pos, const struct iovec *vecs, size_t count);
26 extern "C" ssize_t _kern_writev(int fd, off_t pos, const struct iovec *vecs, size_t count);
52 fssh_readv(int fd, const struct fssh_iovec *vector, int count) in fssh_readv() argument
60 if (FSShell::restricted_file_restrict_io(fd, pos, length) < 0) in fssh_readv()
64 return readv(fd, systemVecs, count); in fssh_readv()
66 return _kern_readv(fd, lseek(fd, 0, SEEK_CUR), systemVecs, count); in fssh_readv()
72 fssh_readv_pos(int fd, fssh_off_t pos, const struct fssh_iovec *vec, int count) in fssh_readv_pos() argument
79 if (FSShell::restricted_file_restrict_io(fd, pos, length) < 0) in fssh_readv_pos()
83 return readv_pos(fd, pos, systemVecs, count); in fssh_readv_pos()
85 return _kern_readv(fd, pos, systemVecs, count); in fssh_readv_pos()
[all …]
/haiku/src/add-ons/kernel/file_systems/ntfs/libntfs/
H A Dwin32_io.c689 static int ntfs_device_win32_getgeo(HANDLE handle, win32_fd *fd) in ntfs_device_win32_getgeo() argument
705 fd->geo_cylinders = ((DISK_GEOMETRY*)&b)->Cylinders.QuadPart; in ntfs_device_win32_getgeo()
706 fd->geo_sectors = ((DISK_GEOMETRY*)&b)->SectorsPerTrack; in ntfs_device_win32_getgeo()
707 fd->geo_size = ((DISK_GEOMETRY_EX*)&b)->DiskSize.QuadPart; in ntfs_device_win32_getgeo()
708 fd->geo_sector_size = NTFS_BLOCK_SIZE; in ntfs_device_win32_getgeo()
711 fd->geo_cylinders = ddi->Int13.MaxCylinders; in ntfs_device_win32_getgeo()
712 fd->geo_sectors = ddi->Int13.SectorsPerTrack; in ntfs_device_win32_getgeo()
713 fd->geo_heads = ddi->Int13.MaxHeads; in ntfs_device_win32_getgeo()
716 fd->geo_cylinders = ddi->ExInt13.ExCylinders; in ntfs_device_win32_getgeo()
717 fd->geo_sectors = ddi->ExInt13.ExSectorsPerTrack; in ntfs_device_win32_getgeo()
[all …]
/haiku/src/system/kernel/disk_device_manager/
H A DKPartitioningSystem.cpp69 int fd = -1; in Identify() local
70 if (partition->Open(O_RDONLY, &fd) != B_OK) in Identify()
73 close(fd); in Identify()
77 float result = fModule->identify_partition(fd, partition->PartitionData(), in Identify()
79 close(fd); in Identify()
91 int fd = -1; in Scan() local
92 status_t result = partition->Open(O_RDONLY, &fd); in Scan()
95 result = fModule->scan_partition(fd, partition->PartitionData(), cookie); in Scan()
96 close(fd); in Scan()
161 int fd = -1; in Resize() local
[all …]
H A DKFileSystem.cpp62 int fd = -1; in Identify() local
63 if (partition->Open(O_RDONLY, &fd) != B_OK) in Identify()
65 float result = fModule->identify_partition(fd, partition->PartitionData(), in Identify()
67 close(fd); in Identify()
78 int fd = -1; in Scan() local
79 status_t result = partition->Open(O_RDONLY, &fd); in Scan()
82 result = fModule->scan_partition(fd, partition->PartitionData(), cookie); in Scan()
83 close(fd); in Scan()
135 int fd = -1; in Resize() local
136 status_t result = partition->Open(O_RDWR, &fd); in Resize()
[all …]
/haiku/src/system/libroot/os/
H A Dfs_attr.cpp25 int fd = _kern_open_attr_dir(file, path, traverse); in open_attr_dir() local
26 if (fd < 0) { in open_attr_dir()
27 __set_errno(fd); in open_attr_dir()
32 if ((dir = __create_dir_struct(fd)) == NULL) { in open_attr_dir()
33 _kern_close(fd); in open_attr_dir()
45 fs_read_attr(int fd, const char* attribute, uint32 /*type*/, off_t pos, in fs_read_attr() argument
48 ssize_t bytes = _kern_read_attr(fd, attribute, pos, buffer, readBytes); in fs_read_attr()
54 fs_write_attr(int fd, const char* attribute, uint32 type, off_t pos, in fs_write_attr() argument
73 ssize_t bytes = _kern_write_attr(fd, attribute, type, pos, buffer, in fs_write_attr()
80 fs_remove_attr(int fd, const char* attribute) in fs_remove_attr() argument
[all …]
/haiku/src/bin/pcmcia-cs/
H A Ddump_cisreg.c91 int fd; in open_sock()
98 fd = open(fn, O_RDONLY); in open_sock()
100 if (fd >= 0) in open_sock()
101 return fd; in open_sock()
111 static int get_reg(int fd, int fn, off_t off) in get_reg() argument
119 ret = ioctl(fd, DS_ACCESS_CONFIGURATION_REGISTER, &arg); in get_reg()
127 static int dump_option(int fd, int fn, int mfc) in dump_option() argument
129 int v = get_reg(fd, fn, CISREG_COR); in dump_option()
146 static void dump_status(int fd, int fn) in dump_status() argument
148 int v = get_reg(fd, fn, CISREG_CCSR); in dump_status()
[all …]
/haiku/src/tests/system/libroot/os/
H A Dfs_attr_test.cpp19 test_read(int fd, const char* attribute, type_code type, const char* data, in test_read() argument
23 if (fs_stat_attr(fd, attribute, &info) != 0) { in test_read()
41 ssize_t bytesRead = fs_read_attr(fd, attribute, B_RAW_TYPE, 0, buffer, in test_read()
60 int fd = open(kTestFileName, O_CREAT | O_TRUNC | O_WRONLY); in main() local
61 if (fd < 0) { in main()
69 fs_write_attr(fd, "TEST", B_STRING_TYPE, 0, "Hello BeOS", 11); in main()
70 test_read(fd, "TEST", B_STRING_TYPE, "Hello BeOS", 11); in main()
73 fs_write_attr(fd, "TEST", B_STRING_TYPE, 6, "Haiku", 6); in main()
74 test_read(fd, "TEST", B_STRING_TYPE, "Hello Haiku", 12); in main()
76 fs_write_attr(fd, "TESTraw", B_RAW_TYPE, 16, "Haiku", 6); in main()
[all …]
/haiku/src/system/kernel/fs/
H A Dfd.cpp49 int fd);
50 static struct file_descriptor* remove_fd(struct io_context* context, int fd);
59 void dump_fd(int fd, struct file_descriptor* descriptor);
62 dump_fd(int fd,struct file_descriptor* descriptor) in dump_fd() argument
67 fd, descriptor, descriptor->ref_count, in dump_fd()
96 fd_close_on_exec(const struct io_context* context, int fd) in fd_close_on_exec() argument
98 return CHECK_BIT(context->fds_close_on_exec[fd / 8], fd & 7) ? true : false; in fd_close_on_exec()
103 fd_set_close_on_exec(struct io_context* context, int fd, bool closeFD) in fd_set_close_on_exec() argument
106 context->fds_close_on_exec[fd / 8] |= (1 << (fd & 7)); in fd_set_close_on_exec()
108 context->fds_close_on_exec[fd / 8] &= ~(1 << (fd & 7)); in fd_set_close_on_exec()
[all …]
/haiku/headers/build/private/kernel/
H A Dsyscalls.h58 extern int _kern_open(int fd, const char *path, int openMode,
62 extern int _kern_open_dir(int fd, const char *path);
63 extern int _kern_open_parent_dir(int fd, char *name,
65 extern status_t _kern_fsync(int fd);
66 extern off_t _kern_seek(int fd, off_t pos, int seekType);
69 extern status_t _kern_create_dir(int fd, const char *path, int perms);
70 extern status_t _kern_read_link(int fd, const char *path, char *buffer,
72 extern status_t _kern_create_symlink(int fd, const char *path,
74 extern status_t _kern_unlink(int fd, const char *path);
77 extern int _kern_open_attr_dir(int fd, const char *path);
[all …]
/haiku/headers/posix/sys/
H A Dselect.h30 #define _FD_BITSINDEX(fd) ((fd) / NFDBITS) argument
31 #define _FD_BIT(fd) (1L << ((fd) % NFDBITS)) argument
34 #define FD_SET(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] |= _FD_BIT(fd)) argument
35 #define FD_CLR(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] &= ~_FD_BIT(fd)) argument
36 #define FD_ISSET(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] & _FD_BIT(fd)) argument
/haiku/src/system/libroot/posix/
H A Dtermios.c18 tcgetattr(int fd, struct termios *termios) in tcgetattr() argument
20 return ioctl(fd, TCGETA, termios); in tcgetattr()
26 tcsetattr(int fd, int opt, const struct termios *termios) in tcsetattr() argument
49 return ioctl(fd, method, termios); in tcsetattr()
55 tcdrain(int fd) in tcdrain() argument
63 return ioctl(fd, TCSBRK, 1); in tcdrain()
69 tcflow(int fd, int action) in tcflow() argument
83 return ioctl(fd, TCXONC, action); in tcflow()
89 tcflush(int fd, int queueSelector) in tcflush() argument
91 return ioctl(fd, TCFLSH, queueSelector); in tcflush()
[all …]
/haiku/src/tests/system/libroot/posix/
H A Dflock_test.cpp23 intptr_t fd = (intptr_t)_fd; in try_to_lock() local
33 if (fcntl(fd, F_SETLK, &flock) == 0) { in try_to_lock()
43 if (fcntl(fd, F_SETLKW, &flock) == -1) { in try_to_lock()
51 if (fcntl(fd, F_SETLK, &flock) == -1) { in try_to_lock()
64 intptr_t fd = open("/etc/passwd", O_RDONLY); in main() local
65 if (fd < 0) { in main()
78 if (fcntl(fd, F_SETLK, &flock) == 0) { in main()
87 if (fcntl(fd, F_SETLK, &flock) == -1) { in main()
93 close(fd); in main()
95 fd = open("/etc/passwd", O_RDWR); in main()
[all …]
/haiku/src/bin/
H A Deject.cpp136 int fd; in do_eject() local
148 fd = open(device, O_RDONLY); in do_eject()
149 if (fd < 0) { in do_eject()
155 if (ioctl(fd, B_EJECT_DEVICE, NULL, 0) < 0) { in do_eject()
157 close(fd); in do_eject()
162 if (ioctl(fd, B_LOAD_MEDIA, NULL, 0) < 0) { in do_eject()
164 close(fd); in do_eject()
170 if (ioctl(fd, B_SCSI_PREVENT_ALLOW, &bval, sizeof(bval)) < 0) { in do_eject()
172 close(fd); in do_eject()
178 if (ioctl(fd, B_SCSI_PREVENT_ALLOW, &bval, sizeof(bval)) < 0) { in do_eject()
[all …]

12345678910>>...23