Cannot build hfs-freebsd-03p1 on 5-current

Yar Tikhiy yar at FreeBSD.org
Fri Feb 20 05:41:02 PST 2004


On Fri, Feb 20, 2004 at 09:11:37PM +0900, Norikatsu Shigemura wrote:
> 	Hum.. I can't compile hfs-freebsd-03p1 on 5-current.
> 	Anyone, do you know this fix?
[...]
> /tmp/hfs-freebsd-03p1/darwin/xnu/bsd/hfs/hfs_readwrite.c: In function `hfs_write':
> /tmp/hfs-freebsd-03p1/darwin/xnu/bsd/hfs/hfs_readwrite.c:341: error: structure has no member named `p_rlimit'

I believe that was due to a recent change in the per-process rlimit structure.
Would you mind trying the patch attached below?

-- 
Yar

--- hfs_readwrite.c	7 Feb 2004 17:27:43 -0000	1.40.2.2
+++ hfs_readwrite.c	20 Feb 2004 13:07:14 -0000
@@ -337,12 +337,14 @@ hfs_write(ap)
 	 * file servers have no limits, I don't think it matters.
 	 */
 	p = uio->uio_td;
-	if (vp->v_type == VREG && p &&
-	    writelimit > p->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+	if (vp->v_type == VREG && p != NULL) {
 		PROC_LOCK(p->td_proc);
-		psignal(p->td_proc, SIGXFSZ);
+		if (writelimit > lim_cur(p->td_proc, RLIMIT_FSIZE)) {
+			psignal(p->td_proc, SIGXFSZ);
+			PROC_UNLOCK(p->td_proc);
+			return (EFBIG);
+		}
 		PROC_UNLOCK(p->td_proc);
-		return (EFBIG);
 	}
 	p = current_proc();
 


More information about the freebsd-fs mailing list