libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / system / libroot / posix / unistd / write.c
blob5776ea861ae98b68cf46dca372aad35e4fecbf6f
1 /*
2 * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2001, Manuel J. Petit. All rights reserved.
6 * Distributed under the terms of the NewOS License.
7 */
10 #include <unistd.h>
12 #include <errno.h>
13 #include <pthread.h>
15 #include <syscall_utils.h>
17 #include <errno_private.h>
18 #include <syscalls.h>
21 ssize_t
22 write(int fd, void const *buffer, size_t bufferSize)
24 int status = _kern_write(fd, -1, buffer, bufferSize);
26 RETURN_AND_SET_ERRNO_TEST_CANCEL(status);
30 ssize_t
31 write_pos(int fd, off_t pos, const void *buffer, size_t bufferSize)
33 if (pos < 0)
34 RETURN_AND_SET_ERRNO_TEST_CANCEL(B_BAD_VALUE);
36 RETURN_AND_SET_ERRNO_TEST_CANCEL(_kern_write(fd, pos, buffer, bufferSize));
40 ssize_t
41 pwrite(int fd, const void *buffer, size_t bufferSize, off_t pos)
43 if (pos < 0)
44 RETURN_AND_SET_ERRNO_TEST_CANCEL(B_BAD_VALUE);
46 RETURN_AND_SET_ERRNO_TEST_CANCEL(_kern_write(fd, pos, buffer, bufferSize));