Index: share/man/man9/alq.9 =================================================================== RCS file: /home/ncvs/src/share/man/man9/alq.9,v retrieving revision 1.5 diff -u -r1.5 alq.9 --- share/man/man9/alq.9 9 Mar 2005 01:56:48 -0000 1.5 +++ share/man/man9/alq.9 16 Apr 2005 10:07:29 -0000 @@ -44,6 +44,7 @@ .Fa "struct alq **app" .Fa "const char *file" .Fa "struct ucred *cred" +.Fa "int cmode" .Fa "int size" .Fa "int count" .Fc @@ -98,10 +99,19 @@ function creates a new logging queue. The .Fa file -argument is the name of the file to open for logging. +argument is the name of the file to open for logging; if the file does not +yet exist, +.Fn alq_open +will attempt to create it. +The +.Fa cmode +argument will be passed to +.Fn vn_open +as the requested creation mode, to be used if the file will be created by +.Fn alq_open . The argument .Fa cred -specifies the credentials to use when opening the file. +specifies the credentials to use when opening and performing I/O on the file. The size of each entry in the queue is determined by .Fa size . The Index: sys/sys/alq.h =================================================================== RCS file: /home/ncvs/src/sys/sys/alq.h,v retrieving revision 1.5 diff -u -r1.5 alq.h --- sys/sys/alq.h 7 Jan 2005 02:29:23 -0000 1.5 +++ sys/sys/alq.h 16 Apr 2005 10:03:51 -0000 @@ -59,6 +59,8 @@ * Arguments: * alq Storage for a pointer to the newly created queue. * file The filename to open for logging. + * cred Credential to authorize open and I/O with. + * cmode Creation mode for file, if new. * size The size of each entry in the queue. * count The number of items in the buffer, this should be large enough * to store items over the period of a disk write. @@ -66,8 +68,8 @@ * error from open or 0 on success */ struct ucred; -int alq_open(struct alq **, const char *file, struct ucred *cred, int size, - int count); +int alq_open(struct alq **, const char *file, struct ucred *cred, int cmode, + int size, int count); /* * alq_write: Write data into the queue Index: sys/kern/kern_alq.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_alq.c,v retrieving revision 1.11 diff -u -r1.11 kern_alq.c --- sys/kern/kern_alq.c 6 Jan 2005 23:35:38 -0000 1.11 +++ sys/kern/kern_alq.c 16 Apr 2005 10:01:35 -0000 @@ -334,8 +334,8 @@ * Create the queue data structure, allocate the buffer, and open the file. */ int -alq_open(struct alq **alqp, const char *file, struct ucred *cred, int size, - int count) +alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int count) { struct thread *td; struct nameidata nd; @@ -353,7 +353,7 @@ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); flags = FWRITE | O_NOFOLLOW | O_CREAT; - error = vn_open_cred(&nd, &flags, 0, cred, -1); + error = vn_open_cred(&nd, &flags, cmode, cred, -1); if (error) return (error); Index: sys/kern/kern_ktr.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_ktr.c,v retrieving revision 1.46 diff -u -r1.46 kern_ktr.c --- sys/kern/kern_ktr.c 1 Nov 2004 22:15:15 -0000 1.46 +++ sys/kern/kern_ktr.c 16 Apr 2005 10:47:56 -0000 @@ -145,7 +145,7 @@ if (error) return (error); error = alq_open(&ktr_alq, (const char *)ktr_alq_file, - req->td->td_ucred, sizeof(struct ktr_entry), + req->td->td_ucred, 0600, sizeof(struct ktr_entry), ktr_alq_depth); if (error == 0) { ktr_mask &= ~KTR_ALQ_MASK; Index: sys/contrib/dev/ath/freebsd/ah_osdep.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/ath/freebsd/ah_osdep.c,v retrieving revision 1.3 diff -u -r1.3 ah_osdep.c --- sys/contrib/dev/ath/freebsd/ah_osdep.c 8 Dec 2004 18:18:39 -0000 1.3 +++ sys/contrib/dev/ath/freebsd/ah_osdep.c 16 Apr 2005 10:47:43 -0000 @@ -185,7 +185,7 @@ error = suser(curthread); if (error == 0) { error = alq_open(&ath_hal_alq, ath_hal_logfile, - curthread->td_ucred, + curthread->td_ucred, 0600, sizeof (struct athregrec), ath_hal_alq_qsize); ath_hal_alq_lost = 0; ath_hal_alq_emitdev = 1;