Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Jul 2007 18:18:14 +0800
From:      LI Xin <delphij@delphij.net>
To:        freebsd-hackers@freebsd.org
Cc:        Robert Watson <rwatson@FreeBSD.org>
Subject:   Re: add closefrom() call
Message-ID:  <468E16E6.6030608@delphij.net>
In-Reply-To: <20070705122650.GE1302@britannica.bec.de>
References:  <de5dfb5a0707041727j3e3518f9l5a019717a9f90aa@mail.gmail.com> <20070705122650.GE1302@britannica.bec.de>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig23E1E1748C2AF3C3A2172CF4
Content-Type: multipart/mixed; boundary="------------080805090703090505090406"

This is a multi-part message in MIME format.
--------------080805090703090505090406
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

Joerg Sonnenberger wrote:
> On Wed, Jul 04, 2007 at 08:27:49PM -0400, Ighighi Ighighi wrote:
>> The closefrom() call, available in Solaris, is present in NetBSD since=

>> version 3.0.
>> It is implemented with the F_CLOSEM fcntl() available since version 2.=
0.
>=20
> You could also add a system call like it was done in DragonFly. That
> might be even simpler to implement.

Here is my implementation for FreeBSD.  Some difference between my and
DragonFly's implementation:

 - closefrom(-1) would be no-op on DragonFly, my version would close all
open files (From my understanding of OpenSolaris's userland
implementation, this is Solaris's behavior).
 - my version closefrom(very_big_fd) would result in EBADF.  I am not
very sure whether this is correct, but it does not hurt for applications
that thinks closefrom() would return void.

To RW:  I have not found a suitable audit event for this, should I
create a new event?

Cheers,
--=20
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!

--------------080805090703090505090406
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
	name="patch-closefrom.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="patch-closefrom.diff"

Index: lib/libc/sys/Symbol.map
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/lib/libc/sys/Symbol.map,v
retrieving revision 1.8
diff -u -p -u -r1.8 Symbol.map
--- lib/libc/sys/Symbol.map	5 Jun 2007 08:24:34 -0000	1.8
+++ lib/libc/sys/Symbol.map	6 Jul 2007 08:38:55 -0000
@@ -65,6 +65,7 @@ FBSD_1.0 {
 	clock_gettime;
 	clock_settime;
 	close;
+	closefrom;
 	connect;
 	dup;
 	dup2;
Index: sys/kern/init_sysent.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/kern/init_sysent.c,v
retrieving revision 1.229
diff -u -p -u -r1.229 init_sysent.c
--- sys/kern/init_sysent.c	4 Jul 2007 22:49:54 -0000	1.229
+++ sys/kern/init_sysent.c	6 Jul 2007 08:12:02 -0000
@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/init_sysent.c,v 1.229 2007/07/04 22:49:54 pete=
r Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/kern/syscalls.master,v 1.232 2007/07/04=
 22:47:37 peter Exp=20
  */
=20
@@ -510,4 +510,5 @@ struct sysent sysent[] =3D {
 	{ AS(lseek_args), (sy_call_t *)lseek, AUE_LSEEK, NULL, 0, 0 },	/* 478 =3D=
 lseek */
 	{ AS(truncate_args), (sy_call_t *)truncate, AUE_TRUNCATE, NULL, 0, 0 },=
	/* 479 =3D truncate */
 	{ AS(ftruncate_args), (sy_call_t *)ftruncate, AUE_FTRUNCATE, NULL, 0, 0=
 },	/* 480 =3D ftruncate */
+	{ AS(closefrom_args), (sy_call_t *)closefrom, AUE_NULL, NULL, 0, 0 },	/=
* 481 =3D closefrom */
 };
Index: sys/kern/kern_descrip.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/kern/kern_descrip.c,v
retrieving revision 1.312
diff -u -p -u -r1.312 kern_descrip.c
--- sys/kern/kern_descrip.c	3 Jul 2007 21:26:06 -0000	1.312
+++ sys/kern/kern_descrip.c	6 Jul 2007 08:04:00 -0000
@@ -989,6 +989,44 @@ fgetown(sigiop)
 }
=20
 /*
+ * Close many file descriptors.
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct closefrom_args {
+	int	fd;
+};
+#endif
+/* ARGSUSED */
+int
+closefrom(struct thread *td, struct closefrom_args *uap)
+{
+
+	return(kern_closefrom(td, uap->fd));
+}
+
+int
+kern_closefrom(struct thread *td, int fd)
+{
+	struct filedesc *fdp;
+	int currfd;
+
+	fdp =3D td->td_proc->p_fd;
+
+	if (fd > fdp->fd_lastfile)
+		return (EBADF);
+	else if (fd < 0)
+		fd =3D 0;
+
+	MPASS(fd >=3D 0);
+
+	while ((currfd =3D fdp->fd_lastfile) >=3D fd)
+		if (kern_close(td, currfd) =3D=3D EINTR)
+			return (EINTR);
+
+	return (0);
+}
+
+/*
  * Close a file descriptor.
  */
 #ifndef _SYS_SYSPROTO_H_
Index: sys/kern/syscalls.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/kern/syscalls.c,v
retrieving revision 1.213
diff -u -p -u -r1.213 syscalls.c
--- sys/kern/syscalls.c	4 Jul 2007 22:49:55 -0000	1.213
+++ sys/kern/syscalls.c	6 Jul 2007 08:12:02 -0000
@@ -2,7 +2,7 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/syscalls.c,v 1.213 2007/07/04 22:49:55 peter E=
xp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/kern/syscalls.master,v 1.232 2007/07/04=
 22:47:37 peter Exp=20
  */
=20
@@ -488,4 +488,5 @@ const char *syscallnames[] =3D {
 	"lseek",			/* 478 =3D lseek */
 	"truncate",			/* 479 =3D truncate */
 	"ftruncate",			/* 480 =3D ftruncate */
+	"closefrom",			/* 481 =3D closefrom */
 };
Index: sys/kern/syscalls.master
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/kern/syscalls.master,v
retrieving revision 1.232
diff -u -p -u -r1.232 syscalls.master
--- sys/kern/syscalls.master	4 Jul 2007 22:47:37 -0000	1.232
+++ sys/kern/syscalls.master	6 Jul 2007 07:41:28 -0000
@@ -846,5 +846,6 @@
 				    int whence); }
 479	AUE_TRUNCATE	STD	{ int truncate(char *path, off_t length); }
 480	AUE_FTRUNCATE	STD	{ int ftruncate(int fd, off_t length); }
+481	AUE_NULL	STD	{ int closefrom(int fd); }
 ; Please copy any additions and changes to the following compatability t=
ables:
 ; sys/compat/freebsd32/syscalls.master
Index: sys/kern/systrace_args.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/kern/systrace_args.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 systrace_args.c
--- sys/kern/systrace_args.c	4 Jul 2007 22:49:55 -0000	1.13
+++ sys/kern/systrace_args.c	6 Jul 2007 08:12:02 -0000
@@ -2,7 +2,7 @@
  * System call argument to DTrace register array converstion.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/systrace_args.c,v 1.13 2007/07/04 22:49:55 pet=
er Exp $
+ * $FreeBSD$
  * This file is part of the DTrace syscall provider.
  */
=20
@@ -2862,6 +2862,13 @@ systrace_args(int sysnum, void *params,=20
 		*n_args =3D 2;
 		break;
 	}
+	/* closefrom */
+	case 481: {
+		struct closefrom_args *p =3D params;
+		iarg[0] =3D p->fd; /* int */
+		*n_args =3D 1;
+		break;
+	}
 	default:
 		*n_args =3D 0;
 		break;
Index: sys/compat/freebsd32/freebsd32_proto.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_proto.h,v
retrieving revision 1.77
diff -u -p -u -r1.77 freebsd32_proto.h
--- sys/compat/freebsd32/freebsd32_proto.h	4 Jul 2007 23:03:50 -0000	1.77=

+++ sys/compat/freebsd32/freebsd32_proto.h	6 Jul 2007 09:57:00 -0000
@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.77 2007/07/0=
4 23:03:50 peter Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90=
 2007/07/04 23:02:40 peter Exp=20
  */
=20
Index: sys/compat/freebsd32/freebsd32_syscall.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_syscall.h,v
retrieving revision 1.75
diff -u -p -u -r1.75 freebsd32_syscall.h
--- sys/compat/freebsd32/freebsd32_syscall.h	4 Jul 2007 23:03:50 -0000	1.=
75
+++ sys/compat/freebsd32/freebsd32_syscall.h	6 Jul 2007 09:57:00 -0000
@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.75 2007/07=
/04 23:03:50 peter Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90=
 2007/07/04 23:02:40 peter Exp=20
  */
=20
@@ -337,4 +337,5 @@
 #define	FREEBSD32_SYS_freebsd32_lseek	478
 #define	FREEBSD32_SYS_freebsd32_truncate	479
 #define	FREEBSD32_SYS_freebsd32_ftruncate	480
-#define	FREEBSD32_SYS_MAXSYSCALL	481
+#define	FREEBSD32_SYS_closefrom	481
+#define	FREEBSD32_SYS_MAXSYSCALL	482
Index: sys/compat/freebsd32/freebsd32_syscalls.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_syscalls.c,v
retrieving revision 1.66
diff -u -p -u -r1.66 freebsd32_syscalls.c
--- sys/compat/freebsd32/freebsd32_syscalls.c	4 Jul 2007 23:03:50 -0000	1=
=2E66
+++ sys/compat/freebsd32/freebsd32_syscalls.c	6 Jul 2007 09:57:00 -0000
@@ -2,7 +2,7 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.66 2007/0=
7/04 23:03:50 peter Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90=
 2007/07/04 23:02:40 peter Exp=20
  */
=20
@@ -488,4 +488,5 @@ const char *freebsd32_syscallnames[] =3D {
 	"freebsd32_lseek",			/* 478 =3D freebsd32_lseek */
 	"freebsd32_truncate",			/* 479 =3D freebsd32_truncate */
 	"freebsd32_ftruncate",			/* 480 =3D freebsd32_ftruncate */
+	"closefrom",			/* 481 =3D closefrom */
 };
Index: sys/compat/freebsd32/freebsd32_sysent.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/compat/freebsd32/freebsd32_sysent.c,v
retrieving revision 1.76
diff -u -p -u -r1.76 freebsd32_sysent.c
--- sys/compat/freebsd32/freebsd32_sysent.c	4 Jul 2007 23:03:50 -0000	1.7=
6
+++ sys/compat/freebsd32/freebsd32_sysent.c	6 Jul 2007 09:57:00 -0000
@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.76 2007/07/=
04 23:03:50 peter Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90=
 2007/07/04 23:02:40 peter Exp=20
  */
=20
@@ -519,4 +519,5 @@ struct sysent freebsd32_sysent[] =3D {
 	{ AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NU=
LL, 0, 0 },	/* 478 =3D freebsd32_lseek */
 	{ AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRU=
NCATE, NULL, 0, 0 },	/* 479 =3D freebsd32_truncate */
 	{ AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_F=
TRUNCATE, NULL, 0, 0 },	/* 480 =3D freebsd32_ftruncate */
+	{ AS(closefrom_args), (sy_call_t *)closefrom, AUE_NULL, NULL, 0, 0 },	/=
* 481 =3D closefrom */
 };
Index: sys/compat/freebsd32/syscalls.master
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/compat/freebsd32/syscalls.master,v
retrieving revision 1.90
diff -u -p -u -r1.90 syscalls.master
--- sys/compat/freebsd32/syscalls.master	4 Jul 2007 23:02:40 -0000	1.90
+++ sys/compat/freebsd32/syscalls.master	6 Jul 2007 09:56:37 -0000
@@ -794,3 +794,4 @@
 				    u_int32_t lengthlo, u_int32_t lengthhi); }
 480	AUE_FTRUNCATE	STD	{ int freebsd32_ftruncate(int fd, \
 				    u_int32_t lengthlo, u_int32_t lengthhi); }
+481	AUE_NULL	NOPROTO	{ int closefrom(int fd); }
Index: sys/sys/syscall.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/sys/syscall.h,v
retrieving revision 1.210
diff -u -p -u -r1.210 syscall.h
--- sys/sys/syscall.h	4 Jul 2007 22:49:55 -0000	1.210
+++ sys/sys/syscall.h	6 Jul 2007 08:12:02 -0000
@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/syscall.h,v 1.210 2007/07/04 22:49:55 peter Exp=
 $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/kern/syscalls.master,v 1.232 2007/07/04=
 22:47:37 peter Exp=20
  */
=20
@@ -400,4 +400,5 @@
 #define	SYS_lseek	478
 #define	SYS_truncate	479
 #define	SYS_ftruncate	480
-#define	SYS_MAXSYSCALL	481
+#define	SYS_closefrom	481
+#define	SYS_MAXSYSCALL	482
Index: sys/sys/syscall.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/sys/syscall.mk,v
retrieving revision 1.165
diff -u -p -u -r1.165 syscall.mk
--- sys/sys/syscall.mk	4 Jul 2007 22:49:55 -0000	1.165
+++ sys/sys/syscall.mk	6 Jul 2007 08:12:02 -0000
@@ -1,6 +1,6 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
-# $FreeBSD: src/sys/sys/syscall.mk,v 1.165 2007/07/04 22:49:55 peter Exp=
 $
+# $FreeBSD$
 # created from FreeBSD: src/sys/kern/syscalls.master,v 1.232 2007/07/04 =
22:47:37 peter Exp=20
 MIASM =3D  \
 	syscall.o \
@@ -348,4 +348,5 @@ MIASM =3D  \
 	mmap.o \
 	lseek.o \
 	truncate.o \
-	ftruncate.o
+	ftruncate.o \
+	closefrom.o
Index: sys/sys/syscallsubr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/sys/syscallsubr.h,v
retrieving revision 1.46
diff -u -p -u -r1.46 syscallsubr.h
--- sys/sys/syscallsubr.h	7 Jun 2007 19:45:19 -0000	1.46
+++ sys/sys/syscallsubr.h	6 Jul 2007 08:02:13 -0000
@@ -73,6 +73,7 @@ int	kern_clock_gettime(struct thread *td
 int	kern_clock_settime(struct thread *td, clockid_t clock_id,
 	    struct timespec *ats);
 int	kern_close(struct thread *td, int fd);
+int	kern_closefrom(struct thread *td, int fd);
 int	kern_connect(struct thread *td, int fd, struct sockaddr *sa);
 int	kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg,
 	    int flags);
Index: sys/sys/sysproto.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/sys/sysproto.h,v
retrieving revision 1.214
diff -u -p -u -r1.214 sysproto.h
--- sys/sys/sysproto.h	4 Jul 2007 22:49:55 -0000	1.214
+++ sys/sys/sysproto.h	6 Jul 2007 08:12:02 -0000
@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/sysproto.h,v 1.214 2007/07/04 22:49:55 peter Ex=
p $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/kern/syscalls.master,v 1.232 2007/07/04=
 22:47:37 peter Exp=20
  */
=20
@@ -1515,6 +1515,9 @@ struct ftruncate_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
 	char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)=
];
 };
+struct closefrom_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+};
 int	nosys(struct thread *, struct nosys_args *);
 void	sys_exit(struct thread *, struct sys_exit_args *);
 int	fork(struct thread *, struct fork_args *);
@@ -1853,6 +1856,7 @@ int	mmap(struct thread *, struct mmap_ar
 int	lseek(struct thread *, struct lseek_args *);
 int	truncate(struct thread *, struct truncate_args *);
 int	ftruncate(struct thread *, struct ftruncate_args *);
+int	closefrom(struct thread *, struct closefrom_args *);
=20
 #ifdef COMPAT_43
=20
@@ -2416,6 +2420,7 @@ int	freebsd4_sigreturn(struct thread *,=20
 #define	SYS_AUE_lseek	AUE_LSEEK
 #define	SYS_AUE_truncate	AUE_TRUNCATE
 #define	SYS_AUE_ftruncate	AUE_FTRUNCATE
+#define	SYS_AUE_closefrom	AUE_NULL
=20
 #undef PAD_
 #undef PADL_
Index: crypto/openssh/config.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/crypto/openssh/config.h,v
retrieving revision 1.19
diff -u -p -u -r1.19 config.h
--- crypto/openssh/config.h	6 Oct 2006 14:27:26 -0000	1.19
+++ crypto/openssh/config.h	6 Jul 2007 08:34:23 -0000
@@ -187,7 +187,7 @@
 #define HAVE_CLOCK_T 1
=20
 /* Define to 1 if you have the `closefrom' function. */
-/* #undef HAVE_CLOSEFROM */
+#define HAVE_CLOSEFROM 0
=20
 /* Define if gai_strerror() returns const char * */
 #define HAVE_CONST_GAI_STRERROR_PROTO 1
Index: crypto/openssh/ssh_namespace.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/crypto/openssh/ssh_namespace.h,v
retrieving revision 1.2
diff -u -p -u -r1.2 ssh_namespace.h
--- crypto/openssh/ssh_namespace.h	30 Sep 2006 13:38:05 -0000	1.2
+++ crypto/openssh/ssh_namespace.h	6 Jul 2007 09:11:24 -0000
@@ -145,7 +145,6 @@
 #define ciphers_valid				ssh_ciphers_valid
 #define cleanhostname				ssh_cleanhostname
 #define cleanup_exit				ssh_cleanup_exit
-#define closefrom				ssh_closefrom
 #define colon					ssh_colon
 #define compat_cipher_proposal			ssh_compat_cipher_proposal
 #define compat_datafellows			ssh_compat_datafellows

--------------080805090703090505090406--

--------------enig23E1E1748C2AF3C3A2172CF4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGjhbmOfuToMruuMARCuP0AJsH6jN/TLKwW8Znfpd2WRkc1C6gqQCfaWQG
2+rX9OYa9lF3YaqBaYB332M=
=I82c
-----END PGP SIGNATURE-----

--------------enig23E1E1748C2AF3C3A2172CF4--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?468E16E6.6030608>