Patch #: 136 Type: operational change Priority: none Modification: add support for SGI IRIX statfs() for file quotas Submitted: John W. Schwegler Submitted: Geoffrey Warren Hicks Submitted: David Hornsby Archived: munnari.OZ.AU mac/cap.patches/cap60.patch136 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch136' Summary: change code to handle different fn. args, #include file File: cap60/applications/aufs/afpos.c File: cap60/conf.func.lst *** applications/aufs/afpos.c.orig Tue Apr 13 16:12:02 1993 --- applications/aufs/afpos.c Tue Apr 13 21:58:43 1993 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/04/13 06:11:36 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.29 1993/04/13 06:11:36 djh Rel djh $ ! * $Revision: 2.29 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1993/04/13 11:46:31 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.30 1993/04/13 11:46:31 djh Rel djh $ ! * $Revision: 2.30 $ */ /* *************** *** 50,55 **** --- 50,56 ---- * information doesn't tell us how much space is there -- only * how much is free and we need both * USESTATFS - statfs is the Sun NFS solution to volume information. + * (has modified call arguments and structure elements under SGI IRIX). * * PERMISSIVE_USER_NAME - let the Chooser name be from the gcos field * *************** *** 124,130 **** #endif USEUSTAT #ifdef USESTATFS ! # include #endif USESTATFS #ifdef AIX --- 125,135 ---- #endif USEUSTAT #ifdef USESTATFS ! # ifdef sgi ! # include ! # else sgi ! # include ! # endif sgi #endif USESTATFS #ifdef AIX *************** *** 2200,2212 **** struct stat buf; #ifdef USEQUOTA struct dqblk dqblk; ! #endif #ifdef USEUSTAT struct ustat ubuf; ! #endif #ifdef USESTATFS struct statfs fsbuf; ! #endif time_t sometime; if (stat(path,&buf) != 0) /* directory exists? */ --- 2205,2217 ---- struct stat buf; #ifdef USEQUOTA struct dqblk dqblk; ! #endif USEQUOTA #ifdef USEUSTAT struct ustat ubuf; ! #endif USEUSTAT #ifdef USESTATFS struct statfs fsbuf; ! #endif USESTATFS time_t sometime; if (stat(path,&buf) != 0) /* directory exists? */ *************** *** 2293,2298 **** --- 2298,2311 ---- } #endif #ifdef USESTATFS + # ifdef sgi + if (statfs(path, &fsbuf, sizeof(fsbuf), 0) >= 0) { + v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; + /* limiting factor: cannot report on overutilization of a volume */ + v->v_free = (fsbuf.f_bfree < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bfree; + return(noErr); + } + # else sgi if (statfs(path, &fsbuf) >= 0) { v->v_size = fsbuf.f_bsize * fsbuf.f_blocks; /* limiting factor: cannot report on overutilization of a volume */ *************** *** 2299,2305 **** v->v_free = (fsbuf.f_bavail < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bavail; return(noErr); } ! #endif #ifdef SIZESERVER getvolsize(path, &v->v_size, &v->v_free); #else SIZESERVER --- 2312,2319 ---- v->v_free = (fsbuf.f_bavail < 0) ? 0 : fsbuf.f_bsize * fsbuf.f_bavail; return(noErr); } ! # endif sgi ! #endif USESTATFS #ifdef SIZESERVER getvolsize(path, &v->v_size, &v->v_free); #else SIZESERVER *** conf.func.lst.orig Wed Mar 13 19:56:01 1991 --- conf.func.lst Tue Apr 13 22:04:46 1993 *************** *** 1,6 **** ! # $Author: djh $ $Date: 91/03/13 19:55:28 $ ! # $Header: conf.func.lst,v 2.2 91/03/13 19:55:28 djh Exp $ ! # $Revision: 2.2 $ # # see Conf.func.sh for format of file # --- 1,6 ---- ! # $Author: djh $ $Date: 1993/04/13 12:04:09 $ ! # $Header: /mac/src/cap60/RCS/conf.func.lst,v 2.3 1993/04/13 12:04:09 djh Rel djh $ ! # $Revision: 2.3 $ # # see Conf.func.sh for format of file # *************** *** 9,14 **** --- 9,15 ---- E,GETOPT,x,x,"cap: will use public domain getopt" N+-,GETMNT,/usr/include/sys/mount.h,getmnt,"aufs: info on file systems (dec)" N+-,STATFS,/usr/include/sys/vfs.h,statfs,"aufs: info on file systems (sun nfs)" + N+-,STATFS,/usr/include/sys/statfs.h,statfs,"aufs: info on file systems (irix)" E,GETOPT,x,x,"aufs: no space information on volumes will be available" N+-,QUOTA,/usr/include/sys/quota.h,quota,"aufs: info on user quota" E,QUOTA,x,x,"aufs: no information on user quotas" *** lib/cap/abversion.c.orig Tue Apr 13 20:49:07 1993 --- lib/cap/abversion.c Tue Apr 13 22:06:05 1993 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/04/13 10:49:00 $ ! * $Header: /mac/src/cap60/lib/cap/RCS/abversion.c,v 2.35 1993/04/13 10:49:00 djh Rel djh $ ! * $Revision: 2.35 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1993/04/13 12:05:58 $ ! * $Header: /mac/src/cap60/lib/cap/RCS/abversion.c,v 2.36 1993/04/13 12:05:58 djh Rel djh $ ! * $Revision: 2.36 $ */ /* *************** *** 31,37 **** myversion.cv_name = "CAP"; myversion.cv_version = 6; myversion.cv_subversion = 0; ! myversion.cv_patchlevel = 135; myversion.cv_rmonth = "April"; myversion.cv_ryear = "1993"; switch (lap_proto) { --- 31,37 ---- myversion.cv_name = "CAP"; myversion.cv_version = 6; myversion.cv_subversion = 0; ! myversion.cv_patchlevel = 136; myversion.cv_rmonth = "April"; myversion.cv_ryear = "1993"; switch (lap_proto) { *** README.orig Tue Apr 13 20:50:16 1993 --- README Tue Apr 13 22:07:03 1993 *************** *** 2,8 **** CAP - Columbia AppleTalk Package for UNIX o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 135, April 1993 Notice ------ --- 2,8 ---- CAP - Columbia AppleTalk Package for UNIX o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 136, April 1993 Notice ------