about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-09-08 08:41:45 +0000
committerGreg McGary <greg@mcgary.org>2000-09-08 08:41:45 +0000
commite694422de52750c6a0469e1be89fbf97d3ff8bf2 (patch)
tree0b2bcd452740874ce1ad25a55cb42af0efe141a7
parent9b4a6eac68b7997e93f0d09bfe703b7c429a8fee (diff)
downloadglibc-e694422de52750c6a0469e1be89fbf97d3ff8bf2.tar.gz
glibc-e694422de52750c6a0469e1be89fbf97d3ff8bf2.tar.xz
glibc-e694422de52750c6a0469e1be89fbf97d3ff8bf2.zip
* sysdeps/unix/sysv/linux/syscalls.list (mincore): Fix arg signature.
* sysdeps/unix/make-syscalls.sh: New signature keyletter `V'. 
* sysdeps/generic/bp-checks.h (CHECK_N_PAGES): New macro.
2000-09-08  Greg McGary  <greg@mcgary.org>

	* sysdeps/unix/sysv/linux/syscalls.list (mincore): Fix arg signature.
	* sysdeps/unix/make-syscalls.sh: New signature keyletter `V'.
	* sysdeps/generic/bp-checks.h (CHECK_N_PAGES): New macro.
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/generic/bp-checks.h9
-rw-r--r--sysdeps/unix/make-syscalls.sh4
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list2
4 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b4af7b8e6..399a35e657 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-09-08  Greg McGary  <greg@mcgary.org>
+
+	* sysdeps/unix/sysv/linux/syscalls.list (mincore): Fix arg signature.
+	* sysdeps/unix/make-syscalls.sh: New signature keyletter `V'.
+	* sysdeps/generic/bp-checks.h (CHECK_N_PAGES): New macro.
+
 2000-09-08  Andreas Jaeger  <aj@suse.de>
 
 	* sysdeps/unix/sysv/linux/arm/lockf64.c: New file.
diff --git a/sysdeps/generic/bp-checks.h b/sysdeps/generic/bp-checks.h
index 01acf9f4ae..41ffad71e1 100644
--- a/sysdeps/generic/bp-checks.h
+++ b/sysdeps/generic/bp-checks.h
@@ -90,6 +90,14 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
   (((CMD) == F_GETLK || (CMD) == F_SETLK || (CMD) == F_SETLKW)	\
    ? CHECK_1 ((struct flock *) ARG) : (unsigned long) (ARG))
 
+/* Check bounds of an array of mincore residency-status flags that
+   cover a region of NBYTES.  Such a vector occupies one byte per page
+   of memory.  */
+# define CHECK_N_PAGES(ARG, NBYTES)				\
+  ({ int _page_size_ = sysconf (_SC_PAGE_SIZE);			\
+     CHECK_N ((const char *) (ARG),				\
+	      ((NBYTES) + _page_size_ - 1) / _page_size_); })
+
 /* Return a bounded pointer with value PTR that satisfies CHECK_N (PTR, N).  */
 # define BOUNDED_N(PTR, N) 				\
   ({ __typeof (PTR) __bounded _p_;			\
@@ -113,6 +121,7 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
 # define CHECK_SIGSET_NULL_OK(SET) (SET)
 # define CHECK_IOCTL(ARG, CMD) (ARG)
 # define CHECK_FCNTL(ARG, CMD) (ARG)
+# define CHECK_N_PAGES(ARG, NBYTES) (ARG)
 # define BOUNDED_N(PTR, N) (PTR)
 
 #endif /* !__BOUNDED_POINTERS__ */
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index 728c1e7471..37890b458e 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -21,6 +21,7 @@
 # s: non-NULL string (e.g., 1st arg to open)
 # S: optionally-NULL string (e.g., 1st arg to acct)
 # v: vararg scalar (e.g., optional 3rd arg to open)
+# V: byte-per-page vector (3rd arg to mincore)
 # W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4)
 
 ptr='[abBfFINpPsSW]'	# all pointer keyletters
@@ -232,7 +233,7 @@ shared-only-routines += $file
     # generate extern decls of dummy variables for each arg
     echo "	 echo '`echo $args | \
 	    sed -e 's/<\('$typ'[1-9]\)>/extern \1, \1v;/g' \
-		-e 's/<\([abBFIsS][1-9]\)>/extern char \1v;/g' \
+		-e 's/<\([abBFIsSV][1-9]\)>/extern char \1v;/g' \
 		-e 's/<\([Wv][1-9]\)>/extern int \1v;/g'` \\'; \\"
 
     # generate bounded-pointer thunk declarator
@@ -255,6 +256,7 @@ shared-only-routines += $file
 	    sed -e 's/<b0>/BOUNDED_N (/' \
 		-e 's/<.0>//'`($callname) (`echo $arglist | \
 	    sed -e 's/<\(a[1-9]\)>/__ptrvalue (\1a)/g' \
+		-e 's/<\(n[1-9]\)>, <\(V[1-9]\)>/\1a, CHECK_N_PAGES (\2a, \1a)/g' \
 		-e 's/<\(b[1-9]\)>, <\(n[1-9]\)>/CHECK_N (\1a, \2a), \2a/g' \
 		-e 's/<\(b[1-9]\)>, <\(N[1-9]\)>/CHECK_N (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \
 		-e 's/<\(B[1-9]\)>, <\(n[1-9]\)>/CHECK_N_NULL_OK (\1a, \2a), \2a/g' \
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index bff42d8a2b..9dd5f4ca31 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -22,7 +22,7 @@ iopl		-	iopl		i:i	iopl
 klogctl		EXTRA	syslog		i:isi	klogctl
 lchown		-	lchown		i:sii	__lchown	lchown
 madvise		-	madvise		i:pii	posix_madvise	madvise
-mincore		-	mincore		i:iip	mincore
+mincore		-	mincore		i:anV	mincore
 mlock		EXTRA	mlock		i:bn	__mlock	mlock
 mlockall	EXTRA	mlockall	i:i	__mlockall	mlockall
 mmap		-	mmap		b:aniiii	__mmap		mmap