setrlimit code

2011-07-08 Thread Stuart Henderson
On 2011/07/08 20:51, Henning Brauer wrote: > CVSROOT: /cvs > Module name: src > Changes by: henn...@cvs.openbsd.org 2011/07/08 20:51:18 > > Modified files: > usr.sbin/bgpd : rde.c session.c > > Log message: > remove that rlimit code, rc.d and login classes do it much betterer thes

Re: show cache in top

2011-07-08 Thread Otto Moerbeek
On Sat, Jul 09, 2011 at 12:56:12AM -0400, Ted Unangst wrote: > Top said I didn't have much memory free. Where did it all go? > > Oh, here it is: > > Memory: Real: 391M/2730M act/tot Free: 178M Cache: 1711M Swap: 0K/4097M I like the idea, but I think "Cache" is ot the ricght name. How about BCa

show cache in top

2011-07-08 Thread Ted Unangst
Top said I didn't have much memory free. Where did it all go? Oh, here it is: Memory: Real: 391M/2730M act/tot Free: 178M Cache: 1711M Swap: 0K/4097M Index: machine.c === RCS file: /home/tedu/cvs/src/usr.bin/top/machine.c,v retriev

Re: small fix in ehci

2011-07-08 Thread Eric Faurot
So, there is actually another bug in that chunk of code. This diff fixes them: - Read the register from the correct location: HCSPARAMS is a capability register. - Construct the resulting mask correctly by adding parenthesis where needed: '|' takes precedence over '?' so currently the expr

Re: libX11 incorrect libpthread linkage

2011-07-08 Thread Matthieu Herrb
On Fri, Jul 08, 2011 at 04:22:55PM +0200, David Coppa wrote: > Hi, > > Isn't this wrong? It may be wrong indeed. I don't think it matters before rthreads are ready. Anyways don't change it without having someone run a full ports test build first. > > $ cat /usr/X11R6/lib/pkgconfig/x11.pc >

Re: test(1) TEST.*

2011-07-08 Thread Matthew Dempsky
On Fri, Jul 8, 2011 at 9:50 PM, Nicholas Marriott wrote: > Move TEST.sh to regress/bin/test/ and remove bin/test/TEST.*. > > ok? Makes sense to me. ok matthew@

test(1) TEST.*

2011-07-08 Thread Nicholas Marriott
Move TEST.sh to regress/bin/test/ and remove bin/test/TEST.*. ok? Index: regress/bin/test/Makefile --- /dev/null +++ regress/bin/test/Makefile @@ -0,0 +1,8 @@ +# $OpenBSD$ + +REGRESS_TARGETS= run_test + +run_test: + @test=/bin/test /bin/sh TEST.sh >/dev/null + +.include Index: regre

Re: futex implementation in compat

2011-07-08 Thread Paul Irofti
Changes as suggested by tedu@.Also the cas() diff is in. Index: files.linux === RCS file: /cvs/src/sys/compat/linux/files.linux,v retrieving revision 1.16 diff -u -p -r1.16 files.linux --- files.linux 9 Jul 2011 00:10:52 - 1

Cleanup umass_scsi.c to use SCSI_NO_ADAPTER_TARGET

2011-07-08 Thread Matthew Dempsky
Diff below simplifies umass(4) slightly: instead of attaching a two target bus and reserving one target for the "host" (which doesn't do anything), just attach a one target bus and let the SCSI subsystem know that no target is reserved for the adapter. Basically, this just changes the dmesg line f

Testers needed for sdmmc_scsi.c diff

2011-07-08 Thread Matthew Dempsky
Please check that SD cards still work with this diff. Index: sdmmc_scsi.c === RCS file: /cvs/src/sys/dev/sdmmc/sdmmc_scsi.c,v retrieving revision 1.28 diff -u -p -r1.28 sdmmc_scsi.c --- sdmmc_scsi.c9 Jul 2011 00:39:29 -

Re: futex implementation in compat

2011-07-08 Thread Paul Irofti
On Fri, Jul 08, 2011 at 08:39:34PM -0400, Ted Unangst wrote: > On Sat, Jul 09, 2011, Paul Irofti wrote: > > Mostly for people asking for my secret diffs. > > > > This is the cas diff... > > > +int > > +tstohz(const struct timespec *ts) > > +{ > > > +int > > +itimespecfix(struct timespec *ts) > >

Re: futex implementation in compat

2011-07-08 Thread Ted Unangst
On Sat, Jul 09, 2011, Paul Irofti wrote: > Mostly for people asking for my secret diffs. > > This is the cas diff... > +int > +tstohz(const struct timespec *ts) > +{ > +int > +itimespecfix(struct timespec *ts) > +{ These functions can't go here with these names. That's too generic. Add futex p

futex implementation in compat

2011-07-08 Thread Paul Irofti
Mostly for people asking for my secret diffs. This is the cas diff... Index: i386/locore.s === RCS file: /cvs/src/sys/arch/i386/i386/locore.s,v retrieving revision 1.137 diff -u -p -r1.137 locore.s --- i386/locore.s 5 Jul 2011

Re: Kludge to 'fix' sdmmc_scsi.c

2011-07-08 Thread Kenneth R Westerback
On Fri, Jul 08, 2011 at 04:34:36PM -0700, Matthew Dempsky wrote: > autoconf doesn't allow you to attach multiple child devices to the > same device with different attach arg types. sdmmc(4) tries to attach > both scsibus(4) and SDIO devices (currently just the disabled sbt(4) > bluetooth adapter).

Kludge to 'fix' sdmmc_scsi.c

2011-07-08 Thread Matthew Dempsky
autoconf doesn't allow you to attach multiple child devices to the same device with different attach arg types. sdmmc(4) tries to attach both scsibus(4) and SDIO devices (currently just the disabled sbt(4) bluetooth adapter). The way it does this is by creating a sdmmc_attach_args structure that

Re: wol for xl(4)

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 11:18:59PM +0200, Thomas Gerlach wrote: > however, there's still the following problem: > if wol is enabled via /etc/hostname.xl0 (by adding the wol keyword), > it's not possible to log into the system, since the error messages "xl0: > transmission error: ff" and "xl0: comma

More disklabel fixes (hppa/hppa64/macppc/sgi)

2011-07-08 Thread Kenneth R Westerback
If we have successfully found and read in the disk block we expect to hold the OpenBSD disklabel, then what is there must be treated as the disklabel. If it is currently invalid (e.g. all zeros) we still want to write the new label in this MD location, and thus should pass the spoofed label back up

Re: wol for xl(4)

2011-07-08 Thread Thomas Gerlach
On 07/08/2011 02:56 PM, Stefan Sperling wrote: > On Mon, Jun 27, 2011 at 09:31:26AM +, Thomas Gerlach wrote: >> Tobias Ulmer tmux.org> writes: >> >>> I've lost track which patches need to be applied or not, but once a >>> complete patch appears, I'm willing to test it on a machine that has >>>

More buffer cache - second diff.

2011-07-08 Thread Bob Beck
Mark kettenis found an issue with the cleaner on the previous diff I sent out. This diff fixes his issue, replaces the earlier diff. Previous comments apply, please test in lots of places. Index: kern/kern_sysctl.c ===

Re: Reading RAID 1 volumes is slow

2011-07-08 Thread Piotr Durlej
On Fri, 8 Jul 2011, Marco Peereboom wrote: > On Fri, Jul 08, 2011 at 09:39:26PM +0200, Piotr Durlej wrote: > > Reading RAID 1 volumes can be slow because of the way reads are > > interleaved: > > > > # dd if=/dev/rsd0c of=/dev/null bs=1m count=256 > > 256+0 records in > > 256+0 records out > > 2

Re: netatalk

2011-07-08 Thread Henning Brauer
forgot to mention, that gets us rid of the best switch statement ever: case SIOCSIFADDR: switch (ifa->ifa_addr->sa_family) { #ifdef NETATALK case AF_APPLETALK: /* Nothing to do. */ break; #endif /* NETATALK */

Re: Reading RAID 1 volumes is slow

2011-07-08 Thread Marco Peereboom
On Fri, Jul 08, 2011 at 09:39:26PM +0200, Piotr Durlej wrote: > Reading RAID 1 volumes can be slow because of the way reads are > interleaved: > > # dd if=/dev/rsd0c of=/dev/null bs=1m count=256 > 256+0 records in > 256+0 records out > 268435456 bytes transferred in 1.841 secs (145780529 bytes/se

Reading RAID 1 volumes is slow

2011-07-08 Thread Piotr Durlej
Reading RAID 1 volumes can be slow because of the way reads are interleaved: # dd if=/dev/rsd0c of=/dev/null bs=1m count=256 256+0 records in 256+0 records out 268435456 bytes transferred in 1.841 secs (145780529 bytes/sec) # dd if=/dev/rsd1c of=/dev/null bs=1m count=256 256+0 records in 256+0 re

Support for F_DUPFD_CLOEXEC

2011-07-08 Thread Matthew Dempsky
Similar to O_CLOEXEC, F_DUPFD_CLOEXEC allows you to dup a file descriptor and atomically have FD_CLOEXEC set. (Also POSIX Issue 7.) ok? Index: sys/fcntl.h === RCS file: /home/mdempsky/anoncvs/cvs/src/sys/sys/fcntl.h,v retrieving rev

Fix OpenBSD disklabel location on macppc dpme partition

2011-07-08 Thread Kenneth R Westerback
A bit of confusion crept in somewhere along the line and LABELSECTOR was being added to the hfspartition offset, which caused the OpenBSD disklabel to be read from sector 1 on the disk, rather than sector 0. To compensate the hfspartition offset was decremented to make the location come out as be

fix race in pipe

2011-07-08 Thread Ted Unangst
if we sleep during the copyout, we don't want weird stuff to happen to our fds. and in the 99.99% case where you neither sleep nor contend on the lock, no change. Index: sys_pipe.c === RCS file: /home/tedu/cvs/src/sys/kern/sys_pipe.c

Re: wcsdup

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 04:51:47PM +0100, Nicholas Marriott wrote: > Except it isn't sizeof(b) or '\0'. Ooops, right. It's counting in units of ints. > This actually passes the right length to mbstowcs as well: This looks good to me. > Index: wcsdup.3 > =

Re: BSD Authentication for popa3d(8)

2011-07-08 Thread Nicholas Marriott
I think this is wrong. WHat do you expect this line to do? > + user = name; I think modifying user might be better left outside. Also: - You don't need endpwent() for getpwnam() so you can remove that. - One of those silly _XFOOBAR defines hides the strsep definition. I guess they can ju

Re: libedit readline bugs

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 04:23:14PM +0100, Nicholas Marriott wrote: > On Fri, Jul 08, 2011 at 10:31:19AM +0200, Stefan Sperling wrote: > > On Fri, Jul 08, 2011 at 06:21:17AM +0100, Nicholas Marriott wrote: > > > EL_BIND and EL_SETTC must have their argument lists end in NULL. > > > > > > ok? > > >

Re: kdump: struct stat and struct sockaddr

2011-07-08 Thread Otto Moerbeek
On Fri, Jul 08, 2011 at 07:43:04PM +0300, Paul Irofti wrote: > > /usr/src/usr.bin/ktrace/ktrace.c: In function 'main': > /usr/src/usr.bin/ktrace/ktrace.c:66: error: 'KTRFAC_STRUCT' undeclared > (first use in this function) > /usr/src/usr.bin/ktrace/ktrace.c:66: error: (Each undeclared identifier

Re: FFS trim support part 1

2011-07-08 Thread Kenneth R Westerback
On Fri, Jul 08, 2011 at 03:44:49AM -0600, Theo de Raadt wrote: > If you do try the "full trim" diff from Ted, you should not use > softdep. The softdep is making some assumptions and taking some > rather nasty actions when ffs_blkfree returns early. > > Test softdep, but not with trim. > Test tri

Re: move p_emul to process

2011-07-08 Thread Ted Unangst
On Fri, Jul 08, 2011, Paul Irofti wrote: >> There is a macro named p_emul, now, so no more variables of that name. >> See below. > > Ah, I really don't like this. Its confusing. Don't worry, guenther convinced me we don't need this.

Re: kdump: struct stat and struct sockaddr

2011-07-08 Thread Paul Irofti
On Fri, Jul 08, 2011 at 02:23:22PM +0200, Otto Moerbeek wrote: > On Tue, Jul 05, 2011 at 07:09:38PM +0200, Otto Moerbeek wrote: > > > On Tue, Jul 05, 2011 at 06:17:53PM +0200, Otto Moerbeek wrote: > > > > > On Tue, Jul 05, 2011 at 12:08:26PM -0400, Ted Unangst wrote: > > > > > > > On Tue, Jul 05

Re: kdump: struct stat and struct sockaddr

2011-07-08 Thread Nicholas Marriott
I like this a lot, it reads good to me and works great on i386. Sorry for not testing sooner :-/. I'd like to see struct termios and sigaction too :-). On Fri, Jul 08, 2011 at 02:23:22PM +0200, Otto Moerbeek wrote: > On Tue, Jul 05, 2011 at 07:09:38PM +0200, Otto Moerbeek wrote: > > > On Tue, J

Re: move p_emul to process

2011-07-08 Thread Paul Irofti
On Fri, Jul 08, 2011 at 04:40:16AM -0400, Ted Unangst wrote: > On Fri, Jul 08, 2011, Paul Irofti wrote: > > On Fri, Jul 08, 2011 at 01:35:18AM -0400, Ted Unangst wrote: > >> I don't think we're ever going to support different threads of a process > >> running with different emulations, so move p_em

Re: wcsdup

2011-07-08 Thread Nicholas Marriott
Except it isn't sizeof(b) or '\0'. This actually passes the right length to mbstowcs as well: Index: wcsdup.3 === RCS file: /cvs/src/lib/libc/string/wcsdup.3,v retrieving revision 1.2 diff -u -p -r1.2 wcsdup.3 --- wcsdup.35 Jul 20

dkcsum: do not sleep whilst walking alldevs

2011-07-08 Thread Joel Sing
Currently dkcsumattach() walks the alldevs list whilst performing operations that will sleep. This is rather bad if the list happens to be modified (i.e. a device detachs) whilst it is sleeping. The following diff resolves this issue. The process is very similar to that used for softraid - we main

Re: libedit readline bugs

2011-07-08 Thread Nicholas Marriott
On Fri, Jul 08, 2011 at 10:31:19AM +0200, Stefan Sperling wrote: > On Fri, Jul 08, 2011 at 06:21:17AM +0100, Nicholas Marriott wrote: > > EL_BIND and EL_SETTC must have their argument lists end in NULL. > > > > ok? > > > > To make sure I understood correctly, it crashes in ct_decode_argv() > bec

Re: wcsdup

2011-07-08 Thread Nicholas Marriott
On Fri, Jul 08, 2011 at 10:18:59AM +0200, Stefan Sperling wrote: > On Fri, Jul 08, 2011 at 03:01:45AM +0100, Nicholas Marriott wrote: > > Index: wcsdup.3 > > === > > RCS file: /cvs/src/lib/libc/string/wcsdup.3,v > > retrieving revision

libX11 incorrect libpthread linkage

2011-07-08 Thread David Coppa
Hi, Isn't this wrong? $ cat /usr/X11R6/lib/pkgconfig/x11.pc prefix=/usr/X11R6 exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include xthreadlib=-lpthread Name: X11 Description: X Library Version: 1.4.3 Requires: xproto kbproto Requires.private: xcb >= 1.1.92 Cflags: -I${i

Re: wol for xl(4)

2011-07-08 Thread Stefan Sperling
On Mon, Jun 27, 2011 at 09:31:26AM +, Thomas Gerlach wrote: > Tobias Ulmer tmux.org> writes: > > > > > I've lost track which patches need to be applied or not, but once a > > complete patch appears, I'm willing to test it on a machine that has > > three different xl's. > > > > > > > hi t

Re: kdump: struct stat and struct sockaddr

2011-07-08 Thread Otto Moerbeek
On Tue, Jul 05, 2011 at 07:09:38PM +0200, Otto Moerbeek wrote: > On Tue, Jul 05, 2011 at 06:17:53PM +0200, Otto Moerbeek wrote: > > > On Tue, Jul 05, 2011 at 12:08:26PM -0400, Ted Unangst wrote: > > > > > On Tue, Jul 05, 2011, Otto Moerbeek wrote: > > > > Hi, > > > > > > > > this adds decoding

Re: find(1): add support for terminating '+' in -exec

2011-07-08 Thread Eivind E
On Sun, 26 Jun 2011, Pascal Stumpf wrote: This is my first try at getting support for terminating '+' in find(1)'s -exec statement to work, as required by POSIX. Code shamelessly guttenberged from NetBSD, with some minor modifications. FWIW, it's been working nicely here for some time now.

Dyango - Discografia mas pendrive de regalo

2011-07-08 Thread Discos MP3 - Solo de Oferta
20 éxitos / Cae la noche / Agua de lluvia / Bienvenido al club / Al fin solos/ Vuela conmigo / Contigo a la distancia / Corazón de bolero / La magia de Dyango / Amante Gaviota / Colección

Support for O_CLOEXEC and O_DIRECTORY

2011-07-08 Thread Matthew Dempsky
I recall someone (maybe oga and/or djm?) being interested in having O_CLOEXEC support. While here, I noticed POSIX defines O_DIRECTORY, which is pretty trivial to implement as well. Tested that these both work as expected on directory and non-directory files. ok? Index: sys/fcntl.h ===

Support for AT_REMOVEDIR

2011-07-08 Thread Matthew Dempsky
I missed one flag: AT_REMOVEDIR. This makes unlinkat() behave the same as rmdir(), and the diff below changes sys_rmdir() to call dounlinkat() using it. Here's how to read this diff and be convinced it's correct: 1. First read dounlinkat() by itself, and convince yourself that if flag ==

Re: Expose openat(2), etc in libc

2011-07-08 Thread Stuart Henderson
On 2011/07/08 03:51, Matthew Dempsky wrote: > On Fri, Jul 8, 2011 at 3:45 AM, Stuart Henderson wrote: > > On 2011/07/08 01:53, Matthew Dempsky wrote: > >> Now that all of the new AT_* flags are supported, it's okay to expose > >> openat(2), etc. in libc. > >> > >> This will need at least a minor l

Re: another one bites the dust

2011-07-08 Thread Theo de Raadt
No diff -N, but I assume you were removing it. Good.

another one bites the dust

2011-07-08 Thread Ted Unangst
COMPAT_09 is now extra officially dead. Only one function actually used, moved to linux compat. Index: compat/linux/linux_misc.c === RCS file: /home/tedu/cvs/src/sys/compat/linux/linux_misc.c,v retrieving revision 1.70 diff -u -p -r1

Re: Expose openat(2), etc in libc

2011-07-08 Thread Matthew Dempsky
On Fri, Jul 8, 2011 at 3:45 AM, Stuart Henderson wrote: > On 2011/07/08 01:53, Matthew Dempsky wrote: >> Now that all of the new AT_* flags are supported, it's okay to expose >> openat(2), etc. in libc. >> >> This will need at least a minor libc bump (not included below). I >> know martynas@ has

Re: Expose openat(2), etc in libc

2011-07-08 Thread Stuart Henderson
On 2011/07/08 01:53, Matthew Dempsky wrote: > Now that all of the new AT_* flags are supported, it's okay to expose > openat(2), etc. in libc. > > This will need at least a minor libc bump (not included below). I > know martynas@ has a major bump planned for libc, so I figure it makes > sense to

Re: FFS trim support part 1

2011-07-08 Thread Theo de Raadt
If you do try the "full trim" diff from Ted, you should not use softdep. The softdep is making some assumptions and taking some rather nasty actions when ffs_blkfree returns early. Test softdep, but not with trim. Test trim, but not with softdep :)

Expose openat(2), etc in libc

2011-07-08 Thread Matthew Dempsky
Now that all of the new AT_* flags are supported, it's okay to expose openat(2), etc. in libc. This will need at least a minor libc bump (not included below). I know martynas@ has a major bump planned for libc, so I figure it makes sense to either go before that or ride the same bump. Opinions w

Re: move p_emul to process

2011-07-08 Thread Ted Unangst
On Fri, Jul 08, 2011, Paul Irofti wrote: > On Fri, Jul 08, 2011 at 01:35:18AM -0400, Ted Unangst wrote: >> I don't think we're ever going to support different threads of a process >> running with different emulations, so move p_emul and p_emuldata to >> struct process. This uses the p__pgid kinfo_

Re: libedit readline bugs

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 06:21:17AM +0100, Nicholas Marriott wrote: > EL_BIND and EL_SETTC must have their argument lists end in NULL. > > ok? > To make sure I understood correctly, it crashes in ct_decode_argv() because it ends up passing a garbage pointer to mbstowcs(), right? If so, ok. If no

Re: powerpc interrupt rewrite.

2011-07-08 Thread Stuart Henderson
On 2011/07/07 19:30, Dale Rahn wrote: > At c2k11 I managed to revive the powerpc (macppc/socppc) interrupt > rewrite from a few years ago. It had been backed out because of problems > attributed to other previously fixed bugs. At some prodding the dust > was blown off the diff and it is working on

Re: wcsdup

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 03:01:45AM +0100, Nicholas Marriott wrote: > Index: wcsdup.3 > === > RCS file: /cvs/src/lib/libc/string/wcsdup.3,v > retrieving revision 1.2 > diff -u -p -r1.2 wcsdup.3 > --- wcsdup.3 5 Jul 2011 19:01:31 -

Re: move p_emul to process

2011-07-08 Thread Paul Irofti
On Fri, Jul 08, 2011 at 01:35:18AM -0400, Ted Unangst wrote: > I don't think we're ever going to support different threads of a process > running with different emulations, so move p_emul and p_emuldata to > struct process. This uses the p__pgid kinfo_proc hack to allow p_emul > to remain as a mac