Searched refs:fd (Results 126 - 150 of 571) sorted by relevance

1234567891011>>

/haiku/src/tools/hack_coff/
H A Dhack-coff.c34 int fd; local
45 if ((fd = open(av[1], 2)) == -1) {
49 if (read(fd, &fhdr, sizeof(fhdr)) != sizeof(fhdr))
57 if (read(fd, &aout, aoutsz) != aoutsz)
61 if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))
73 if (lseek(fd, (long) sizeof(struct external_filehdr), 0) == -1
74 || write(fd, &aout, aoutsz) != aoutsz) {
78 close(fd);
/haiku/headers/build/host/darwin/
H A Dfcntl.h37 int unlinkat(int fd, const char *path, int flag);
38 int futimesat(int fd, const char *path, const struct timeval times[2]);
/haiku/src/system/libroot/posix/
H A Dfcntl.cpp48 openat(int fd, const char *path, int openMode, ...) argument
59 RETURN_AND_SET_ERRNO_TEST_CANCEL(_kern_open(fd, path, openMode, perms));
64 fcntl(int fd, int op, ...) argument
71 status_t error = _kern_fcntl(fd, op, argument);
81 posix_fadvise(int fd, off_t offset, off_t len, int advice) argument
89 if (fstat(fd, &stat) < 0)
100 posix_fallocate(int fd, off_t offset, off_t len) argument
105 int error = _kern_preallocate(fd, offset, len);
/haiku/src/bin/network/ftpd/
H A Dlogwtmp.c62 static int fd = -1; variable
84 if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
86 if (fstat(fd, &buf) == 0) {
91 if (write(fd, &ut, sizeof(struct utmp)) !=
93 (void)ftruncate(fd, buf.st_size);
/haiku/src/build/libbe/storage/
H A DFile.cpp164 int fd = _kern_open_entry_ref(ref->device, ref->directory, ref->name, local
166 if (fd >= 0) {
167 set_fd(fd);
171 fcntl(fd, F_SETFD, FD_CLOEXEC);
174 fCStatus = fd;
208 int fd = _kern_open(entry->fDirFd, entry->fName, openMode, local
210 if (fd >= 0) {
211 set_fd(fd);
215 fcntl(fd, F_SETFD, FD_CLOEXEC);
217 fCStatus = fd;
247 int fd = _kern_open(-1, path, openMode, DEFFILEMODE & ~__gUmask); local
289 int fd = _kern_open(dir->fDirFd, path, openMode, DEFFILEMODE & ~__gUmask); local
486 int fd = _kern_dup(file.get_fd()); local
[all...]
/haiku/src/libs/bsd/
H A Dpty.cpp51 login_tty(int fd) argument
55 if (ioctl(fd, TIOCSCTTY, NULL) != 0)
58 dup2(fd, 0);
59 dup2(fd, 1);
60 dup2(fd, 2);
62 close(fd);
/haiku/src/libs/stdc++/legacy/
H A Dfstream.cc57 fstreambase::fstreambase(int fd) argument
60 _IO_file_attach(rdbuf(), fd); local
70 fstreambase::fstreambase(int fd, char *p, int l) argument
77 _IO_file_attach(rdbuf(), fd); local
94 void fstreambase::attach(int fd) argument
96 if (!rdbuf()->attach(fd))
/haiku/src/system/libroot/posix/unistd/
H A Dchown.c18 common_chown(int fd, const char* path, bool followLinks, uid_t owner, argument
34 status = _kern_write_stat(fd, path, followLinks, &stat,
56 fchown(int fd, uid_t owner, gid_t group) argument
58 return common_chown(fd, NULL, false, owner, group);
63 fchownat(int fd, const char* path, uid_t owner, gid_t group, int flag) argument
65 return common_chown(fd, path, (flag & AT_SYMLINK_NOFOLLOW) == 0, owner,
/haiku/src/tests/system/network/ipv6/
H A Draw_server.cpp21 recvLoop(int fd) argument
29 int status = recvfrom(fd, buffer, sizeof(buffer) - 1, 0,
61 int fd = socket(socketFamily, SOCK_RAW, TEST_PROTOCOL); local
62 if (fd < 0) {
78 if (bind(fd, (sockaddr *)&localAddress, socketFamily == AF_INET ?
85 recvLoop(fd);
H A Dudp_server.cpp21 recvLoop(int fd) argument
29 int status = recvfrom(fd, buffer, sizeof(buffer) - 1, 0,
58 int fd = socket(socketFamily, SOCK_DGRAM, 0); local
59 if (fd < 0) {
78 if (bind(fd, (sockaddr *)&localAddress, socketFamily == AF_INET ?
85 recvLoop(fd);
H A Dtcp_udp_client.cpp67 int fd = socket(socketFamily1, socketType, 0); local
68 if (fd < 0) {
77 if (connect(fd, (sockaddr *) &saddr, socketFamily2 == AF_INET ?
80 close(fd);
86 int status = send(fd, buffer, length, 0);
96 close(fd);
/haiku/src/tests/system/network/
H A Dipv46_client.cpp55 int fd = socket(socketFamily1, socketType, 0); local
56 if (fd < 0) {
65 if (connect(fd, (sockaddr *) &saddr, socketFamily2 == AF_INET ?
68 close(fd);
74 int ret = send(fd, buffer, len, 0);
86 close(fd);
/haiku/src/add-ons/kernel/partitioning_systems/gpt/
H A DHeader.h19 Header(int fd, uint64 lastBlock,
44 status_t WriteEntry(int fd, uint32 entryIndex);
45 status_t Write(int fd);
50 status_t _WriteHeader(int fd);
51 status_t _Write(int fd, off_t offset, const void* data,
57 status_t _Read(int fd, off_t offset, void* data,
/haiku/headers/private/storage/
H A Dstorage_support.h112 FDCloser(int fd) argument
113 : fFD(fd)
122 void SetTo(int fd) argument
125 fFD = fd;
140 int fd = fFD; local
142 return fd;
/haiku/src/system/boot/loader/
H A Dloader.cpp75 int fd = open_maybe_packaged(volume, sKernelPaths[i][0], O_RDONLY); local
76 if (fd >= 0) {
80 return fd;
99 int fd = find_kernel(bootVolume); local
100 if (fd < 0)
103 close(fd);
113 int fd = find_kernel(volume, &name); local
114 if (fd < B_OK)
115 return fd;
121 status_t status = elf_load_image(fd,
149 int fd = open_maybe_packaged(volume, path, O_RDONLY); local
[all...]
/haiku/src/tools/fs_shell/
H A Dfd.cpp8 #include "fd.h"
35 /*** General fd routines ***/
39 void dump_fd(int fd, struct file_descriptor *descriptor);
42 dump_fd(int fd,struct file_descriptor *descriptor) argument
44 fssh_dprintf("fd[%d] = %p: type = %d, ref_count = %d, ops = %p, u.vnode = %p, u.mount = %p, cookie = %p, open_mode = %x, pos = %lld\n",
45 fd, descriptor, (int)descriptor->type, (int)descriptor->ref_count, descriptor->ops,
74 fd_close_on_exec(struct io_context *context, int fd) argument
76 return CHECK_BIT(context->fds_close_on_exec[fd / 8], fd & 7) ? true : false;
81 fd_set_close_on_exec(struct io_context *context, int fd, boo argument
98 int fd = -1; local
213 get_fd(struct io_context *context, int fd) argument
243 remove_fd(struct io_context *context, int fd) argument
272 dup_fd(int fd, bool kernel) argument
360 select_fd(int fd, uint8_t event, uint32_t ref, struct select_sync *sync, bool kernel) argument
387 deselect_fd(int fd, uint8_t event, struct select_sync *sync, bool kernel) argument
416 fd_is_valid(int fd, bool kernel) argument
443 common_close(int fd, bool kernel) argument
469 _kern_read(int fd, fssh_off_t pos, void *buffer, fssh_size_t length) argument
504 _kern_readv(int fd, fssh_off_t pos, const fssh_iovec *vecs, fssh_size_t count) argument
548 _kern_write(int fd, fssh_off_t pos, const void *buffer, fssh_size_t length) argument
583 _kern_writev(int fd, fssh_off_t pos, const fssh_iovec *vecs, fssh_size_t count) argument
627 _kern_seek(int fd, fssh_off_t pos, int seekType) argument
646 _kern_ioctl(int fd, uint32_t op, void *buffer, fssh_size_t length) argument
668 _kern_read_dir(int fd, struct fssh_dirent *buffer, fssh_size_t bufferSize, uint32_t maxCount) argument
693 _kern_rewind_dir(int fd) argument
715 _kern_close(int fd) argument
722 _kern_dup(int fd) argument
[all...]
H A Dpartition_support.cpp65 find_file_restriction(int fd) argument
68 if (unrestricted_fstat(fd, &st) < 0)
99 restricted_file_opened(int fd) argument
101 FileRestriction* restriction = find_file_restriction(fd);
105 lseek(fd, restriction->startOffset, SEEK_SET);
116 restricted_file_closed(int fd) argument
122 restricted_file_restrict_io(int fd, fssh_off_t& pos, fssh_off_t size) argument
124 FileRestriction* restriction = find_file_restriction(fd);
129 pos = lseek(fd, 0, SEEK_CUR);
179 fssh_lseek(int fd, fssh_off_ argument
[all...]
/haiku/src/build/libroot/
H A Dfs_attr_generic.cpp137 int fd = open("/dev/urandom", O_RDONLY); local
138 if (fd < 0) {
139 fd = open("/dev/random", O_RDONLY);
140 if (fd < 0)
146 ssize_t bytesRead = read(fd, buffer, sizeof(buffer));
150 close(fd);
171 get_id_attribute(const char *path, int fd, string& _id) argument
182 ssize_t bytesRead = get_attribute(fd, path, attributeName.c_str(), buffer,
205 set_id_attribute(const char *path, int fd, const char* id) argument
210 if (set_attribute(fd, pat
217 get_attribute_dir_path(NodeRef ref, const char *path, int fd) argument
232 get_attribute_dir_path_needed(NodeRef ref, const char *path, int fd, string& _attrDirPath) argument
258 get_attribute_dir_path(NodeRef ref, const char *path, int fd) argument
269 get_attribute_dir_path_needed(NodeRef ref, const char *path, int fd, string& _attrDirPath) argument
282 ensure_attribute_dir_exists(NodeRef ref, const char *path, int fd) argument
317 open_attr_dir(NodeRef ref, const char *path, int fd) argument
333 get_attribute_path(NodeRef ref, const char *path, int fd, const char *attribute, string &attrPath, string &typePath) argument
358 get_attribute_path_virtual_fd(int fd, const char *attribute, string &attrPath, string &typePath) argument
381 get_attribute_path(int fd, const char *attribute, string &attrPath, string &typePath) argument
420 fs_fopen_attr_dir(int fd) argument
477 fs_fopen_attr(int fd, const char *attribute, uint32 type, int openMode) argument
535 fs_close_attr(int fd) argument
542 fs_read_attr(int fd, const char *attribute, uint32 type, off_t pos, void *buffer, size_t readBytes) argument
567 fs_write_attr(int fd, const char *attribute, uint32 type, off_t pos, const void *buffer, size_t readBytes) argument
602 fs_remove_attr(int fd, const char *attribute) argument
629 fs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo) argument
680 _kern_open_attr_dir(int fd, const char *path) argument
752 _kern_remove_attr(int fd, const char *name) argument
[all...]
/haiku/src/system/libroot/os/arch/x86/
H A Dcompatibility.c23 int _klock_node_(int fd);
24 int _kunlock_node_(int fd);
27 int _kstatfs_(dev_t device, void *whatever, int fd, const char *path, fs_info *info);
63 _klock_node_(int fd) argument
65 return _kern_lock_node(fd);
70 _kunlock_node_(int fd) argument
72 return _kern_unlock_node(fd);
91 _kstatfs_(dev_t device, void *whatever, int fd, const char *path, fs_info *info) argument
94 if (fd >= 0) {
96 if (fstat(fd,
[all...]
/haiku/src/add-ons/kernel/drivers/audio/ac97/sis7018/
H A DSettings.cpp31 int fd = open(gLogFilePath, flags, 0666); local
32 if (fd >= 0)
33 close(fd);
110 int fd = open(gLogFilePath, O_WRONLY | O_APPEND); local
111 if (fd >= 0) {
112 write(fd, buffer, strlen(buffer));
113 close(fd);
/haiku/src/add-ons/kernel/drivers/audio/usb/
H A DSettings.cpp34 int fd = open(gLogFilePath, flags, 0666); local
35 if (fd >= 0)
36 close(fd);
111 int fd = open(gLogFilePath, O_WRONLY | O_APPEND); local
112 if (fd >= 0) {
113 write(fd, buffer, strlen(buffer));
114 close(fd);
/haiku/src/add-ons/kernel/drivers/network/ether/usb_asix/
H A DSettings.cpp38 int fd = open(gLogFilePath, flags, 0666); local
39 if (fd >= 0)
40 close(fd);
119 int fd = open(gLogFilePath, O_WRONLY | O_APPEND); local
120 if (fd >= 0) {
121 write(fd, buffer, strlen(buffer));
122 close(fd);
/haiku/src/tests/add-ons/kernel/drivers/tty/
H A Dtty-test.cpp68 void Add(int fd) argument
70 if (fd < 0 || fd >= FD_SETSIZE) {
71 fprintf(stderr, "FDSet::Add(%d): Invalid FD.\n", fd);
75 FD_SET(fd, this);
76 if (fd >= fCount)
77 fCount = fd + 1;
133 void AddReadFD(int fd) argument
135 fReadSet.Add(fd);
138 void AddWriteFD(int fd) argument
143 AddErrorFD(int fd) argument
305 WriteUntilBlock(int fd) argument
336 ReadDontFail(int fd, int32 size) argument
360 WriteDontFail(int fd, int32 size) argument
385 SetEcho(int fd) argument
407 int fd = open(path, O_RDWR | (master ? 0 : O_NOCTTY)); local
420 close_tty(int &fd) argument
668 int fd = (fTestMaster ? fMaster : fSlave); local
773 int fd = (fTestMaster ? fMaster : fSlave); local
784 int fd = (fTestMaster ? fMaster : fSlave); local
837 int fd = (fTestMaster ? fMaster : fSlave); local
[all...]
/haiku/src/tests/kits/net/
H A Dlink_echo.cpp43 link_client(int fd, const BNetworkAddress& server) argument
52 if (sendto(fd, buffer, length, 0, server, server.Length()) < 0) {
59 ssize_t bytesRead = recvfrom(fd, buffer, kBufferSize - 1, 0, NULL,
73 link_server(int fd) argument
80 ssize_t bytesRead = recvfrom(fd, buffer, kBufferSize - 1, 0, client,
99 if (sendto(fd, buffer, bytesRead, 0, client, client.Length()) < 0) {
153 int fd = socket(AF_LINK, SOCK_DGRAM, 0); local
154 if (fd < 0)
161 if (bind(fd, link, link.Length()) != 0)
165 if (getsockname(fd, lin
[all...]
/haiku/src/tests/add-ons/kernel/file_systems/bfs/fragmenter/
H A Dfragmenter.cpp61 read_from(int fd, off_t pos, void *buffer, size_t size) argument
63 if (lseek(fd, pos, SEEK_SET) < 0
64 || read(fd, buffer, size) != (int)size) {
73 write_to(int fd, off_t pos, const void *buffer, size_t size) argument
75 if (lseek(fd, pos, SEEK_SET) < 0
76 || write(fd, buffer, size) != (int)size) {
147 int fd = open(fileName, O_RDWR); local
148 if (fd < 0) {
156 read_from(fd, 512, &superBlock, sizeof(superBlock));
167 if (fstat(fd,
[all...]

Completed in 147 milliseconds

1234567891011>>