Skip to content

Commit

Permalink
* posix/bits/unistd.h (read, pread, pread64): Use __bos0 instead
Browse files Browse the repository at this point in the history
	of __bos.
	* socket/bits/socket2.h (recv, recvfrom): Likewise.
  • Loading branch information
Roland McGrath committed Mar 1, 2005
1 parent 25e3dd2 commit 95ca9dd
Showing 3 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2005-03-01 Jakub Jelinek <jakub@redhat.com>

* posix/bits/unistd.h (read, pread, pread64): Use __bos0 instead
of __bos.
* socket/bits/socket2.h (recv, recvfrom): Likewise.

2005-03-01 Roland McGrath <roland@redhat.com>

[BZ #721]
24 changes: 12 additions & 12 deletions posix/bits/unistd.h
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@
extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes,
size_t __buflen) __wur;
#define read(fd, buf, nbytes) \
(__bos (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos (buf)) \
? __read_chk (fd, buf, nbytes, __bos (buf)) \
(__bos0 (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \
? __read_chk (fd, buf, nbytes, __bos0 (buf)) \
: read (fd, buf, nbytes))

#ifdef __USE_UNIX98
@@ -36,23 +36,23 @@ extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes,
__off64_t __offset, size_t __bufsize) __wur;
# ifndef __USE_FILE_OFFSET64
# define pread(fd, buf, nbytes, offset) \
(__bos (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos (buf)) \
? __pread64_chk (fd, buf, nbytes, offset, __bos (buf)) \
(__bos0 (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \
? __pread64_chk (fd, buf, nbytes, offset, __bos0 (buf)) \
: pread (fd, buf, offset, nbytes))
# else
# define pread(fd, buf, nbytes, offset) \
(__bos (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos (buf)) \
? __pread_chk (fd, buf, nbytes, offset, __bos (buf)) \
(__bos0 (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \
? __pread_chk (fd, buf, nbytes, offset, __bos0 (buf)) \
: pread (fd, buf, offset, nbytes))
# endif

# ifdef __USE_LARGEFILE64
# define pread64(fd, buf, nbytes, offset) \
(__bos (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos (buf)) \
? __pread64_chk (fd, buf, nbytes, offset, __bos (buf)) \
(__bos0 (buf) != (size_t) -1 \
&& (!__builtin_constant_p (nbytes) || (nbytes) > __bos0 (buf)) \
? __pread64_chk (fd, buf, nbytes, offset, __bos0 (buf)) \
: pread64 (fd, buf, offset, nbytes))
# endif
#endif
8 changes: 4 additions & 4 deletions socket/bits/socket2.h
Original file line number Diff line number Diff line change
@@ -24,15 +24,15 @@
extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen,
int __flags);
#define recv(fd, buf, n, flags) \
(__bos (buf) != (size_t) -1 \
? __recv_chk (fd, buf, n, __bos (buf), flags) \
(__bos0 (buf) != (size_t) -1 \
? __recv_chk (fd, buf, n, __bos0 (buf), flags) \
: recv (fd, buf, n, flags))

extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n,
size_t __buflen, int __flags,
__SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len);
#define recvfrom(fd, buf, n, flags, addr, addr_len) \
(__bos (buf) != (size_t) -1 \
? __recvfrom_chk (fd, buf, n, __bos (buf), flags, addr, addr_len) \
(__bos0 (buf) != (size_t) -1 \
? __recvfrom_chk (fd, buf, n, __bos0 (buf), flags, addr, addr_len) \
: recvfrom (fd, buf, n, flags, addr, addr_len))

0 comments on commit 95ca9dd

Please sign in to comment.