Re: [PATCH] update to the latest libedit version and remove libreadline deps

2010-11-05 Thread Jilles Tjoelker
hy not allow using it. On the other hand, if we can replace it with stubs and is very simplistic, perhaps it is better to stub it out and not change sh. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/list

Re: libkvm: consumers of kvm_getprocs for non-live kernels?

2010-11-10 Thread Jilles Tjoelker
ocs is probably called on a dead kernel is not even used during > build! > So I guess I'm staring at dead code here, any kvm people around that can > clue me in? It is a while ago that I last used this, but ps and fstat definitely worked on crashdumps, to some extent. /usr/

Removing PATH=...%builtin... from sh

2010-12-25 Thread Jilles Tjoelker
completeness one command that should really be a builtin or otherwise magic: Missing POSIX commands found before PATH (regular builtins): newgrp -- Jilles Tjoelker Index: bin/sh/exec.c === --- bin/sh/exec.c (revision 216690) +++ bin/

Re: man 3 getopt char * const argv[] - is const wrong ?

2011-02-13 Thread Jilles Tjoelker
o char *optarg. 2. Many programs declare main's second argument as char *argv[] which cannot be converted to const char *const [], other than via a cast. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/

Basic UTF-8 support for sh(1)

2011-02-25 Thread Jilles Tjoelker
onverted using iconv(3) but as long as it is not unconditionally available in base or if it is not supposed to be used, the codepoints can be encoded in UTF-8 for UTF-8 locales, leaving other locales with question marks. -- Jilles Tjoelker I

Re: [LIBC] Modfied Version of sscanf

2011-05-01 Thread Jilles Tjoelker
rror if the string is too long. Silent truncation might invalidate security checks done elsewhere and can lead to hard-to-diagnose bugs. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Does FreeBSD have replacement for posix_fadvice() or fcntl(F_RDADVISE)?

2011-05-12 Thread Jilles Tjoelker
as little effect: it resets the state of the sequential access detection heuristic but does not disable it. The O_DIRECT open(2) flag has an effect similar to what POSIX_FADV_NOREUSE should do, except that it changes semantics by adding alignment restrictions. -- Jilles

Re: [RFC] rcexecr: rcorder in parallel

2011-06-04 Thread Jilles Tjoelker
n. To avoid this, use waitpid(-1, ...) and maintain more tracking for processes that have already terminated. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: int64_t and printf

2011-06-05 Thread Jilles Tjoelker
sting to a type such as intmax_t or uintmax_t for which a constant format string is available (%jd/%ju). In the particular case of int64_t, it would seem that long long is better than intmax_t, as it is possibly shorter but still guaranteed large enough by C99, but there are objections against thi

tr A-Z a-z in locales other than C

2011-06-06 Thread Jilles Tjoelker
&cnt, (const void *)&(s->lastch)) >= 0 && - charcoll((const void *)&cnt, (const void *)&stopval) <= 0) - *p++ = cnt; - *p = OOBCH; - n = p - s->set; - - s->cnt = 0; -

Re: tr A-Z a-z in locales other than C

2011-06-07 Thread Jilles Tjoelker
On Tue, Jun 07, 2011 at 04:24:43AM +0400, Andrey Chernov wrote: > On Tue, Jun 07, 2011 at 12:41:05AM +0200, Jilles Tjoelker wrote: > > There is a related issue with ranges in regular expressions, glob and > > fnmatch (likewise unspecified by POSIX outside the POSIX locale), but &

Re: tr A-Z a-z in locales other than C

2011-06-07 Thread Jilles Tjoelker
es... TR_LANG, TR_LC_ALL, TR_LC_CTYPE and > TR_LC_COLLATE. done that way, things could be set in /etc/make.conf (or > sys.mk), not need any patching, and not interfere with other uses of > locale. That would be rather ugly. If tr a-z A-Z is supposed to be deceiving in

[PATCH] [RFC] sh(1) vfork support

2011-06-13 Thread Jilles Tjoelker
lstr; + jp->foreground = 1; +#if JOBS + setcurjob(jp); +#endif + } + INTON; + TRACE(("In parent shell: child = %d\n", (int)pid)); + return pid; +} + + /* * Wait for job to finish. * -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: invalid argument in select() when peer socket is in FD_SET

2011-07-31 Thread Jilles Tjoelker
NULL, /* not interested in write */ > (fd_set *) NULL, /* ...or exceptions */ > &tv);/* timeout */ The number of microseconds in a struct timeval must be nonnegative and less than one million (likewise, the number of nanoseconds in a struct times

Re: eliminating a syscall on accept()+ioctl() combo

2011-08-02 Thread Jilles Tjoelker
socket is and in fact Linux always makes the new socket blocking (unless you request non-blocking using their new accept4() call). Because this portability issue can be very subtle, I suggest not blindly relying on it. -- Jilles Tjoelker ___ freebsd-ha

fdopendir() wrongly closes passed fd on error, union mess

2011-08-09 Thread Jilles Tjoelker
; free(dirp); - (void)_close(fd); errno = saved_errno; return (NULL); } -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any ma

Re: Mixing Asynchronous Network I/O and POSIX Threads

2011-09-18 Thread Jilles Tjoelker
hen it overflows you need a "resync" step that is expensive both in CPU and programmer time. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mai

Re: Re[2]: Sharing device driver between kernel and user space

2011-09-23 Thread Jilles Tjoelker
his is unlike the userland sem_post(3) and friends which only require a single atomic op in the uncontested case, except for named semaphores in 8.x and earlier.) > Or if returning EBUSY is acceptable when the resource is in use by > $whatever, maybe you just need a boolean variable. -- Jilles T

Re: Does anyone use nscd?

2011-10-08 Thread Jilles Tjoelker
d be fixed. By the way, SO_NOSIGPIPE is not in POSIX.1-2008 while the MSG_NOSIGNAL flag to send() is. It may be better to replace the write() call with send() with the MSG_NOSIGNAL flag and drop the setsockopt(). -- Jilles Tjoelker ___ freebsd-hackers@freebs

Re: xlocale patch

2011-11-20 Thread Jilles Tjoelker
secmp_l() is in like strcasecmp(). This appears more sensible to me. The header can then be an empty file. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: cron(8) mis-feature with @reboot long after system startup

2011-11-26 Thread Jilles Tjoelker
ure, the @reboot cron script wont > run (since the said file still exists...). The file can be stored in /var/run, which is cleared at boot. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: "ps -e" without procfs(5)

2011-12-04 Thread Jilles Tjoelker
the first place. Given that the AUXV information seems to be used by debuggers only anyway, I think it would be good to move it to p_candebug() now. The full virtual memory maps (KERN_PROC_VMMAP, procstat -v) are already under p_candebug(). -- Jilles Tjoel

Re: "ps -e" without procfs(5)

2011-12-04 Thread Jilles Tjoelker
is does > not look like sensitive information, on the other hand it also seems > to be used by debuggers only. With stack ASLR, the address will not be the same for every process of the same ABI and will be sensitive information. Therefore I think this should b

Re: intent of tab-completion in /bin/sh in 9.0

2012-01-18 Thread Jilles Tjoelker
rg/pipermail/freebsd-arch/2011-December/011976.html -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: intent of tab-completion in /bin/sh in 9.0

2012-01-19 Thread Jilles Tjoelker
On Wed, Jan 18, 2012 at 08:46:18PM -0500, Matthew Story wrote: > On Wed, Jan 18, 2012 at 5:16 PM, Jilles Tjoelker wrote: > > POSIX itself has gradually adopted ksh features, so seeing more of them > > in future is not unlikely. Most of the new language features in 9.0 are > >

sh(1) vfork patch, with benchmarks

2012-01-25 Thread Jilles Tjoelker
een kind enough to try an earlier version of this patch on some sort of ARM board and reports an improvement in boot time from 54 to 51 seconds, and a large difference in microbenchmarks. commit f55a350fa9c3792e10f93160a93d016a7bfdd630 Author: Jilles Tjoelker Date: Mon May 30 00:31:45 2011 +0200

Re: sh(1) vfork patch, with benchmarks

2012-01-25 Thread Jilles Tjoelker
On Wed, Jan 25, 2012 at 11:54:46PM +0100, Jilles Tjoelker wrote: > [snip] > x micro-vfork-timings1-n > + micro-vfork-t

Re: sem(4) lockup in python?

2012-02-05 Thread Jilles Tjoelker
is not a no-op because it tells the kernel to allow for use from multiple processes. Note that the old implementation is still present as well, for compatibility with old binaries. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://l

Re: xargs short-circuit

2012-02-14 Thread Jilles Tjoelker
command exit on a signal or with a value of 255. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: a sysctl for process binary osreldate

2012-03-17 Thread Jilles Tjoelker
ny of the newer things in procstat do not have ps keywords. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: mmap segmentation fault

2012-04-12 Thread Jilles Tjoelker
ly want to map something there, you will have to move your code somewhere else or manipulate your executable to contain a suitable memory area at the required address. Try, for example, procstat -v $$ -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org

Re: [RFC] last(1) with security.bsd.see_other_uids support

2012-06-05 Thread Jilles Tjoelker
tly, only 16 groups can be queried. Therefore the daemon cannot check the process credential for the groups but will have to check the group database for the user.) Also, the attack surface of such a daemon may be smaller than that of a setuid/setgid progr

Re: [RFC] last(1) with security.bsd.see_other_uids support

2012-06-06 Thread Jilles Tjoelker
On Wed, Jun 06, 2012 at 01:20:12PM +0200, Pawel Jakub Dawidek wrote: > On Tue, Jun 05, 2012 at 11:31:01PM +0200, Jilles Tjoelker wrote: > > Also, the attack surface of such a daemon may be smaller than that of a > > setuid/setgid program. > Really? I don't see that. With c

system() using vfork() or posix_spawn()

2012-07-30 Thread Jilles Tjoelker
+ posix_spawnattr_destroy(&attr); (void)_sigaction(SIGINT, &intact, NULL); (void)_sigaction(SIGQUIT, &quitact, NULL); (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: system() using vfork() or posix_spawn()

2012-08-05 Thread Jilles Tjoelker
On Mon, Jul 30, 2012 at 01:53:03PM +0300, Konstantin Belousov wrote: > On Mon, Jul 30, 2012 at 12:24:08PM +0200, Jilles Tjoelker wrote: > > People sometimes use system() from large address spaces where it would > > improve performance greatly to use vfork() instead of fork()

Re: system() using vfork() or posix_spawn() and libthr

2012-08-09 Thread Jilles Tjoelker
On Mon, Aug 06, 2012 at 11:25:35AM +0300, Konstantin Belousov wrote: > On Sun, Aug 05, 2012 at 11:54:32PM +0200, Jilles Tjoelker wrote: > > On Mon, Jul 30, 2012 at 01:53:03PM +0300, Konstantin Belousov wrote: > > > On Mon, Jul 30, 2012 at 12:24:08PM +0200, Jilles Tjoelker wro

Re: system() using vfork() or posix_spawn() and libthr

2012-08-11 Thread Jilles Tjoelker
On Fri, Aug 10, 2012 at 10:16:04AM +0800, David Xu wrote: > On 2012/08/09 18:56, Jilles Tjoelker wrote: > > On Mon, Aug 06, 2012 at 11:25:35AM +0300, Konstantin Belousov wrote: > >> On Sun, Aug 05, 2012 at 11:54:32PM +0200, Jilles Tjoelker wrote: > >>> On Mon, Ju

Re: system() using vfork() or posix_spawn() and libthr

2012-08-14 Thread Jilles Tjoelker
arlier report http://austingroupbugs.net/view.php?id=18 just requested the _Fork() function because an existing application deadlocked when calling fork() from a signal handler. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailma

Re: system() using vfork() or posix_spawn() and libthr

2012-08-16 Thread Jilles Tjoelker
hich signals are affected (such as libc). Alternatively, the kernel could map caught signals to the default action for processes with P_PPWAIT (just like it does not stop such processes because of signals or TTY job control). -- Jilles Tjoelker ___ freebs

Re: system() using vfork() or posix_spawn() and libthr

2012-08-17 Thread Jilles Tjoelker
On Fri, Aug 17, 2012 at 03:43:12PM +0300, Konstantin Belousov wrote: > On Fri, Aug 17, 2012 at 12:39:33AM +0200, Jilles Tjoelker wrote: > > On Thu, Aug 16, 2012 at 02:44:26PM +0300, Konstantin Belousov wrote: > > > BTW, returning to Jilles proposal, can we call vfork() onl

[patch] libc: Do not export .cerror

2012-08-24 Thread Jilles Tjoelker
upon return; the word must be the return address. */ - jb 1f + jb HIDENAME(cerror) ret -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(syscall) .section .note.GNU-stack,"",%progbits -- Jilles Tjoelker

Re: system() using vfork() or posix_spawn() and libthr

2012-08-26 Thread Jilles Tjoelker
On Sun, Aug 19, 2012 at 03:26:36PM +0300, Konstantin Belousov wrote: > On Fri, Aug 17, 2012 at 06:08:47PM +0200, Jilles Tjoelker wrote: > > On Fri, Aug 17, 2012 at 03:43:12PM +0300, Konstantin Belousov wrote: > > > On Fri, Aug 17, 2012 at 12:39:33AM +0200, Jilles Tjoelker wro

Re: [patch] libc: Do not export .cerror

2012-08-31 Thread Jilles Tjoelker
On Tue, Aug 28, 2012 at 02:03:22PM +0300, Konstantin Belousov wrote: > On Sat, Aug 25, 2012 at 12:16:55AM +0200, Jilles Tjoelker wrote: > > Not exporting .cerror causes it to be jumped to directly instead of via > > the PLT. > > The below patch is for i386 only and al

Re: Change vfork() to posix_spawn()?

2012-09-14 Thread Jilles Tjoelker
uid() call itself will set the issetugid flag to true if it changed anything, it does not affect the ability to debug before exec. More general privilege dropping frequently involves frameworks such as PAM which are not async-signal-safe and certainly not vfork-safe. -- Jilles Tjoelker

Re: -lpthread vs -pthread: does -D_REENTRANT matter?

2012-10-14 Thread Jilles Tjoelker
and d at once. This causes a race condition if p->d is written concurrently. Because C99 does not specify threading, it allows these transformations. In C11, they are forbidden. Passing -pthread disables them as well. -- Jilles Tjoelker

Re: -lpthread vs -pthread: does -D_REENTRANT matter?

2012-10-21 Thread Jilles Tjoelker
On Sun, Oct 14, 2012 at 04:55:07PM -0400, Eitan Adler wrote: > On 14 October 2012 10:42, Jilles Tjoelker wrote: > > Because C99 does not specify threading, it allows these transformations. > > In C11, they are forbidden. Passing -pthread disables them as well. > Is the man

[patch] rtld: fix fd leak with parallel dlopen and fork/exec

2012-11-04 Thread Jilles Tjoelker
(wpid == -1) err(1, "waitpid"); if (status != 0) errx(1, "sh -c failed"); } } int main(int argc, char *argv[]) { pthread_t td; int error; if (argc != 2) { fprintf(std

Incorrect use of posix_memalign() (was: Re: svn commit: r243405 - in stable/9: include lib/libc/stdlib)

2012-11-25 Thread Jilles Tjoelker
d of posix_memalign() some_ptr = aligned_alloc(aln, sz); with error checking against some_ptr instead of error. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To uns

Re: Fix overlinking in base aka import pkgconf

2012-12-16 Thread Jilles Tjoelker
here is not much need to run an old base binary against newer base libraries. Apart from that the only advantage is some form of philosophical correctness. For ports this may be a good way to keep static linking working after fixing overlinking caused by libtool's dependency_libs in .la files. --

Re: use after free in grep?

2012-12-20 Thread Jilles Tjoelker
m not sure if hash_table_del() will already free ptr. Yes, and add it back if realloc() fails. A smarter internal interface to the hash table would avoid freeing and reallocating hash table entries here (which might fail). -- Jilles Tjoelker ___ freebs

Re: Request for review, time_pps_fetch() enhancement

2013-02-09 Thread Jilles Tjoelker
s by multiple threads defined either, adding it here only seems to slow down the code (potentially). > > + err = tsleep(pps, PCATCH, "ppsfch", timo); > > + if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { > >

[patch] statfs does not detect -t nullfs -o union as a union mount

2013-02-27 Thread Jilles Tjoelker
work correctly in this regard. The below patch passes through just the MNT_UNION flag of the nullfs mount itself. Perhaps more flags should be passed through. commit fce32a779af4eb977c9b96feb6e4f811d89f2881 Author: Jilles Tjoelker Date: Sat Feb 23 22:22:39 2013 +0100 nullfs: Preserve the

Re: [patch] statfs does not detect -t nullfs -o union as a union mount

2013-03-01 Thread Jilles Tjoelker
On Thu, Feb 28, 2013 at 12:21:44AM +0200, Konstantin Belousov wrote: > On Wed, Feb 27, 2013 at 10:31:42PM +0100, Jilles Tjoelker wrote: > > While testing recent changes to opendir(), I noticed that fstatfs() does > > not return the MNT_UNION flag for a -t nullfs -o union mount.

[patch] SOCK_CLOEXEC, SOCK_NONBLOCK and MSG_CMSG_CLOEXEC

2013-03-17 Thread Jilles Tjoelker
ketops); + finit(fp2, FREAD | FWRITE | fflag, DTYPE_SOCKET, fp2->f_data, + &socketops); + if ((fflag & FNONBLOCK) != 0) { + (void) fo_ioctl(fp1, FIONBIO, &fflag, td->td_ucred, td); + (void) fo_ioctl(fp2, FIONBIO, &fflag, td->td_ucred, td); + } fdrop(fp1, td); fdrop(fp2, td); return (0); -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: [patch] SOCK_CLOEXEC, SOCK_NONBLOCK and MSG_CMSG_CLOEXEC

2013-03-19 Thread Jilles Tjoelker
On Mon, Mar 18, 2013 at 10:59:57PM +0200, Konstantin Belousov wrote: > On Sun, Mar 17, 2013 at 10:23:53PM +0100, Jilles Tjoelker wrote: > > Here are some more modifications to allow creating file descriptors with > > close-on-exec set. Like in linux/glibc, SOCK_CLOEXEC and SOCK_NONB

Re: close(2) while accept(2) is blocked

2013-03-28 Thread Jilles Tjoelker
ead out of accept(2) (at least without resorting to > signals). Pthread cancellation works better than raw signals for this use case. In a proper implementation such as in FreeBSD 9.0 or newer and used properly, it allows avoiding the resource leak that may happen

Re: close(2) while accept(2) is blocked

2013-04-05 Thread Jilles Tjoelker
return (0); } A blocking accept (and some other operations) is waiting on &so->so_timeo. Once it wakes up, it will detect the SBS_CANTRCVMORE bit. A spurious wakeup on so->so_timeo appears harmless (sleep retried) except when lingering on close (SO_LINGER) so this should be fairly safe

Re: Fwd: Where does FreeBSD tr -C differ from tr -c?

2013-04-07 Thread Jilles Tjoelker
new characters from time to time and our tables seem to be updated very rarely. POSIX also says things about collation order. You may not have detected this because FreeBSD does not implement LC_COLLATE for multibyte locales yet. > PS: Who wrote tr -C and how can I contact th

Re: GSOC 2013 project " Kernel Size Reduction for Embedded System "

2013-04-08 Thread Jilles Tjoelker
ed but seem big for what they do for you, and try to make them smaller. The proposal should list concrete parts. * Find variables and functions that are required only during kernel initialization, place them in a special section and add this section to the free memory

Re: GSOC: Qt front-end for freebsd-update

2013-04-14 Thread Jilles Tjoelker
UIs, perhaps a pkgng GUI is more interesting. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

[patch] accept4

2013-04-19 Thread Jilles Tjoelker
). commit 2e410d9260d12328b689b0938e09d09649b0460a Author: Jilles Tjoelker Date: Sat Mar 30 21:44:14 2013 +0100 Add accept4() system call. diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index fef0f3c..105f469 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc

[patch] pipe2

2013-04-21 Thread Jilles Tjoelker
On Sat, Apr 20, 2013 at 12:48:39AM +0200, Jilles Tjoelker wrote: > I'm also working on pipe2() (using linuxulator work) and dup3() (patch > from Jukka A. Ukkonen). This is an implementation of pipe2. As with the accept4 patch, make sysent needs to be run in sys/kern and sys/compat/fre

Re: [patch] pipe2

2013-04-22 Thread Jilles Tjoelker
On Mon, Apr 22, 2013 at 08:31:18PM +0300, Konstantin Belousov wrote: > On Sun, Apr 21, 2013 at 11:02:43PM +0200, Jilles Tjoelker wrote: > > On Sat, Apr 20, 2013 at 12:48:39AM +0200, Jilles Tjoelker wrote: > > > I'm also working on pipe2() (using linuxulator work) and dup3()

Re: Some improvements to rm(1)

2013-04-26 Thread Jilles Tjoelker
using find -x DIR -delete ? There will be an error message 'Device busy' about attempting to delete the mount point but this does not even affect the exit status and all files not under the mount point are removed. -- Jilles Tjoelker _

Re: Some improvements to rm(1)

2013-04-26 Thread Jilles Tjoelker
e primary is safe like -execdir. I'm not entirely sure about this because the rm(1) patch is simple and the new syntax is fairly clear. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/fre

Re: SystemV IPC. Segment info

2013-04-30 Thread Jilles Tjoelker
a flag inside the memory segment that all workers should exit and activate whatever mechanism you use for telling the workers that they need to do something. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Managing userland data pointers in kqueue/kevent

2013-05-19 Thread Jilles Tjoelker
may add (nchanges entries are required for EV_ERROR leaving nchanges for returning other events). > It is not required that these two flags have distinct values; since > one is userland->kernel and the other kernel->userland, they could for > neatness reuse the same bit field.

Re: find -delete broken, or just used improperly?

2013-05-20 Thread Jilles Tjoelker
path, '/') != NULL) + if (entry->fts_level > FTS_ROOTLEVEL && + strchr(entry->fts_accpath, '/') != NULL) errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); -- Jilles Tjo

Re: find -delete broken, or just used improperly?

2013-05-24 Thread Jilles Tjoelker
On Tue, May 21, 2013 at 11:06:39AM -0400, John Baldwin wrote: > On Monday, May 20, 2013 5:47:31 pm Jilles Tjoelker wrote: > > The below patch allows deleting the pathname given to find itself: > > Index: usr.bin/

Re: /bin/sh => STDIN & functions, var scope messing

2013-05-30 Thread Jilles Tjoelker
ch execute the last command in a pipeline in the current shell environment. If things like jobs | cat work, that can also be explained using this rule. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/

Re: Importing tradcpp (traditional (K&R-style) C macro preprocessor) into base?

2013-06-11 Thread Jilles Tjoelker
users in base that cannot be fixed). The "fix" for imake is probably not to use it. Ports that need imake can continue to use it if it depends on a traditional cpp port. A further point of confusion is that things that want a "traditional cpp" in fact want an equivalent of "

Re: make: evaluation of symbolic link with ../ fails

2007-11-06 Thread Jilles Tjoelker
the -P behaviour by default (you need -L to make it use $PWD). -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Re: config(8) patch for review for src dir handling

2007-12-23 Thread Jilles Tjoelker
does not use $PWD, it returns a pathname without symlinks. So that would lead to the original behaviour. A better way could be to use $PWD if it is set and an absolute logical pathname referring to the current directory, as in src/bin/pwd/pwd.c . -- Jilles Tjoelker _

Re: /dev/null & zero inside chroot for make release

2010-05-13 Thread Jilles Tjoelker
unning a devfs (I'm not currently) > Or a jail ? (I dont really want that level of encapsulation ). Mount devfs in your chroot. Then use devfs(8) to limit what's visible in that particular devfs, if you want. -- Jilles Tjoelker ___ freebsd-h

Re: /dev/null & zero inside chroot for make release

2010-05-15 Thread Jilles Tjoelker
This is deprecated as of FreeBSD 5.0 and does not work at all as of FreeBSD 6.0, see mknod(8). Only device nodes in devfs can be used to access devices. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/li

Re: libc symbol versioning difficulties with iconv integration

2010-06-04 Thread Jilles Tjoelker
the iconv > code. If I just unhook the iconv part fromt he build, everything goes > fine. Any ideas? > Patch is here: http://kovesdan.org/patches/iconv-libc.diff There is a .include in iconv/Makefile.inc, what happens if you take that out? -- Jilles Tjoelker ___

Re: Help with some makefile hackery

2010-06-25 Thread Jilles Tjoelker
ut this is fairly complicated. The issue can be sidestepped entirely by sending the output to a file only; a developer can use tail -f to follow the build if necessary. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/ma

Re: ar(1) format_decimal failure is fatal?

2010-08-29 Thread Jilles Tjoelker
(if any) was behind this choice? Would anything break > if it was bumped up to a larger size? Are there other options for a > workaround in my AFS environment? I wonder if the uid/gid fields are useful at all for ar archives. Ar archives are usually not extracted, and when they are

Re: tiny patch to prevent head from closing pipes

2010-08-29 Thread Jilles Tjoelker
ust a 5 > > minute hack in order to see if people find the idea useful or not. > > ;) > Can you give an example of usefulness that does not involve subversion? -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Why I can't trace linux process's childs with truss?

2010-09-10 Thread Jilles Tjoelker
/dev/video0 device, created > by webcamd. Try using ktrace instead of truss. You will need devel/linux_kdump from ports to decode the resulting ktrace.out. Alternatively, if you're familiar with dtrace, you could try that. -- Jilles Tjoelker _

Re: sysrc -- a sysctl(8)-like utility for managing /etc/rc.conf et. al.

2010-10-12 Thread Jilles Tjoelker
ement. There's no restriction > that says you have to put your variable declarations at the beginning > of a block (like in C -- even if only within a superficial block { in > the middle of nowhere } ... like that). > Meanwhile, in Perl, it's quite

Re: Space character in rc.conf variable

2010-10-30 Thread Jilles Tjoelker
well, like ifconfig_wlan0=(ssid "SSID WITH SPACE" dhcp) but then changed some more such that "DHCP" can be used as SSID. Array support would add a fair bit of code to sh, and even then it will remain fairly limited and clumsy. For example, an array can only be returned from a

Re: Pls sanity check my semtimedop(2) implementation

2008-07-18 Thread Jilles Tjoelker
of ITIMER_REAL / SIGALRM? This does not fix the inherent problem. Also, given your use of signals in the first place, your application must be single threaded. This means the ITIMER_VIRTUAL timer does not run while semop(2) is waiting. -- Jilles Tjoelker ___

Re: open(2) and O_NOATIME

2008-10-31 Thread Jilles Tjoelker
Linux's O_NOATIME does not update any times at all (this speeds up things). Anyway, O_NOATIME (only for root/owner) seems a useful feature. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/free

Re: How to tear down a geom mirror?

2009-03-06 Thread Jilles Tjoelker
ro of=/dev/ad1 bs=512 count=79 > dd if=/dev/zero of=/dev/ad2 bs=512 count=79 gmirror and various other geom modules store their metadata on the last sector(s) of the drive, so you need to wipe that too. -- Jilles Tjoelker ___ freebsd-hackers@freeb

Re: bin/113860: sh(1): shell is still running when using `sh -c'

2009-04-03 Thread Jilles Tjoelker
annoyed by seeing silly 'sh -c blah' processes hanging around, and it is not always possible or desirable to add 'exec'. On another note, the EV_EXIT mode is erroneously still used if a trap on EXIT has been set (or, maybe, any trap at all; particularly if -T is in effect). This

Re: bin/113860: sh(1): shell is still running when using `sh -c'

2009-04-12 Thread Jilles Tjoelker
On Fri, Apr 03, 2009 at 11:39:05PM +0200, Jilles Tjoelker wrote: > I think this can be improved. I have a patch now; it does not handle all cases but the effect on the code is minimal. I decided to go with the readahead but only do it for the first line. To avoid problems with traps not be

Re: fdescfs brokenness

2009-05-08 Thread Jilles Tjoelker
d X mode bits are cleared from directories that show up in /dev/fd. It does not come as a surprise to me that that hack does not work. > I think that the actual solution for the walker problems is to > ignore the synthetic filesystems altogether. The info

Re: pthread_mutexattr_getprioceiling error?

2009-06-13 Thread Jilles Tjoelker
my misunderstanding? The priority ceiling is only meaningful with the PTHREAD_PRIO_PROTECT protocol (pthread_mutexattr_setprotocol()). The FreeBSD threads library returns EINVAL if you try to get/set the priority ceiling with another protocol. -- Jilles Tjoelker ___

Re: Regarding Signal IPC

2009-06-19 Thread Jilles Tjoelker
Although I haven't tried this, kqueue's SIGEV_SIGNAL may be helpful in managing this from a single-threaded program. This is, however, not portable. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/

Re: carriage return with stdout and stderr

2009-07-05 Thread Jilles Tjoelker
o stdout. If you are writing to a terminal, stdout is line-buffered. This means that output is flushed when the buffer is full or a '\n' is written. A '\r' is not good enough. You can force a write using fflush(stdout). stderr i

Re: Problem in bin/sh stripping the * character through ${expansion%}

2009-09-11 Thread Jilles Tjoelker
ttern matching characters literally). > In order to strip the trailing star you should use > - > var=${var%[*]} > - > This gives you the pattern of '[*]' that is properly treated as the > single star -- it's a weird way to escape the star in the patterns.

Re: sigwait - differences between Linux & FreeBSD

2009-10-09 Thread Jilles Tjoelker
t the SA_SIGINFO flag if they want queuing. This applies even if the signals are blocked and received using sigwaitinfo(2) or sigtimedwait(2). The SA_SIGINFO flag can only be set by setting a handler using sigaction(2). (Note, this does not mean that all signals are queued if

Re: semaphores between processes

2009-10-22 Thread Jilles Tjoelker
be awakened). This is documented in comments in the source code, but not in man pages or other documentation. > Is there recommended way to do this? Apart from sysv semaphores, perhaps posix named semaphores (sem_open() etc). These require a 'kld

Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH

2009-10-24 Thread Jilles Tjoelker
failed function calls or for functions where it is documented that errno should be used to check for error conditions (example: readdir). -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hacker

Re: [patch] add pwait utility

2009-11-07 Thread Jilles Tjoelker
On Sat, Nov 07, 2009 at 03:01:36PM +0200, Kostik Belousov wrote: > On Sat, Nov 07, 2009 at 11:28:32AM +0100, Gary Jennejohn wrote: > > On Fri, 6 Nov 2009 23:24:46 +0100 > > Jilles Tjoelker wrote: > > > I propose adding a small new utility to /usr/bin: pwait. Similar to t

Re: CFR: Exceedingly minor fixes to libc

2009-11-13 Thread Jilles Tjoelker
he unused entry... */ > - acl->ats_acl.acl_cnt--; > - bzero(&acl->ats_acl.acl_entry[j], > + acl_int->acl_cnt--; > + bzero(&acl_int->acl_entry[j], > sizeof(struct acl_entry)); > acl->ats_cur_entry = 0; > -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Workaround for ntop as daemon, is it ok?

2009-11-27 Thread Jilles Tjoelker
"ports" system does that). As described in the kqueue(2) man page, calling rfork(2) without RFFDG will allow sharing the kqueue between the two processes. As long as the parent process exits quickly, or no "tricks" with file descriptor numbers are done, this

why does _PATH_STDPATH contain the current directory?

2009-12-23 Thread Jilles Tjoelker
onf and/or shell startup files. -- Jilles Tjoelker ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: linprocfs Input/output error

2010-01-01 Thread Jilles Tjoelker
ith EIO. This limit probably has to do with the allocation of a buffer of that size using sbuf_new(9) (and so, malloc(9)). Some sort of limit seems appropriate, but MAXPHYS seems unrelated, and if the request is too long it should perhaps just truncate it. -- Jilles Tjoelker

  1   2   >