Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2009 20:08:51 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r192471 - stable/7/sys/sys
Message-ID:  <200905202008.n4KK8p2E042355@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Wed May 20 20:08:51 2009
New Revision: 192471
URL: http://svn.freebsd.org/changeset/base/192471

Log:
  MFC NDINIT macros without changing the size of nameidata

Modified:
  stable/7/sys/sys/fcntl.h
  stable/7/sys/sys/namei.h

Modified: stable/7/sys/sys/fcntl.h
==============================================================================
--- stable/7/sys/sys/fcntl.h	Wed May 20 20:05:56 2009	(r192470)
+++ stable/7/sys/sys/fcntl.h	Wed May 20 20:08:51 2009	(r192471)
@@ -105,6 +105,12 @@ typedef	__pid_t		pid_t;
 #ifdef _KERNEL
 #define	FHASLOCK	0x4000		/* descriptor holds advisory lock */
 #endif
+/*
+ * Magic value that specify the use of the current working directory
+ * to determine the target of relative file paths in the openat() and
+ * similar syscalls.
+ */
+#define	AT_FDCWD		-100
 
 /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
 #define	O_NOCTTY	0x8000		/* don't assign controlling terminal */

Modified: stable/7/sys/sys/namei.h
==============================================================================
--- stable/7/sys/sys/namei.h	Wed May 20 20:05:56 2009	(r192470)
+++ stable/7/sys/sys/namei.h	Wed May 20 20:08:51 2009	(r192471)
@@ -86,6 +86,9 @@ struct nameidata {
 	 * through the VOP interface.
 	 */
 	struct componentname ni_cnd;
+#ifdef notyet
+	int	ni_dirfd;		/* starting directory for *at functions */	
+#endif
 };
 
 #ifdef _KERNEL
@@ -148,20 +151,31 @@ struct nameidata {
 /*
  * Initialization of a nameidata structure.
  */
-static void NDINIT(struct nameidata *, u_long, u_long, enum uio_seg,
-	    const char *, struct thread *);
+#define	NDINIT(ndp, op, flags, segflg, namep, td)			\
+	NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td)
+#define	NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td)		\
+	NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td)
+#define	NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td)		\
+	NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td)
+
 static __inline void
-NDINIT(struct nameidata *ndp,
+NDINIT_ALL(struct nameidata *ndp,
 	u_long op, u_long flags,
 	enum uio_seg segflg,
 	const char *namep,
+	int dirfd,
+	struct vnode *startdir,
 	struct thread *td)
 {
 	ndp->ni_cnd.cn_nameiop = op;
 	ndp->ni_cnd.cn_flags = flags;
 	ndp->ni_segflg = segflg;
 	ndp->ni_dirp = namep;
+	ndp->ni_startdir = startdir;
 	ndp->ni_cnd.cn_thread = td;
+#ifdef notyet
+	ndp->ni_dirfd = dirfd;
+#endif
 }
 
 #define NDF_NO_DVP_RELE		0x00000001



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