Undefined behaviour in subr_hibernate.c

2016-08-31 Thread Michal Mazurek
- return l < r ? -1 : (l > r); + vaddr_t vl = (vaddr_t)l; + vaddr_t vr = (vaddr_t)r; + + return vl < vr ? -1 : (vl > vr); } RB_PROTOTYPE(hiballoc_addr, hiballoc_entry, hibe_entry, hibe_cmp) -- Michal Mazurek

Array of TAILQs in kern_synch.c

2016-08-31 Thread Michal Mazurek
p->p_wchan = 0; - TAILQ_REMOVE(qp, p, p_runq); + TAILQ_REMOVE(&slpque, p, p_runq); if (p->p_stat == SSLEEP) setrunnable(p); } -- Michal Mazurek

Fix comment in sys/sem.h

2016-09-01 Thread Michal Mazurek
2014 04:31:42 - 1.23 +++ sys/sys/sem.h 1 Sep 2016 07:22:26 - @@ -195,4 +195,4 @@ int semop(int, struct sembuf *, size_t); __END_DECLS #endif /* !_KERNEL */ -#endif /* !_SEM_H_ */ +#endif /* !_SYS_SEM_H_ */ -- Michal Mazurek

Remove last mention of nonexistent ktr_kuser().

2016-09-01 Thread Michal Mazurek
*, size_t); int ktruser(struct proc *, const char *, const void *, size_t); void ktrexec(struct proc *, int, const char *, ssize_t); void ktrpledge(struct proc *, int, uint64_t, int); -- Michal Mazurek

remove MPSAFE from makesyscalls.sh

2016-09-01 Thread Michal Mazurek
not need locks sycall_flags = sprintf("SY_NOLOCK | %s", sycall_flags) f++ -- Michal Mazurek

sys_process.c: remove relebad

2016-09-01 Thread Michal Mazurek
if (SCARG(uap, pid) < THREAD_PID_OFFSET && tr->ps_single) -- Michal Mazurek

Futexes for OpenBSD

2016-09-02 Thread Michal Mazurek
scallargs.h 27 Jun 2016 16:52:01 - 1.185 +++ sys/sys/syscallargs.h 2 Sep 2016 13:10:02 - @@ -1,4 +1,4 @@ -/* $OpenBSD: syscallargs.h,v 1.185 2016/06/27 16:52:01 jsing Exp $ */ +/* $OpenBSD$ */ /* * System call argument lists. @@ -1098,6 +1098,15 @@ struct sys___set_tcb_args { syscallarg(void *) tcb; }; +struct sys_futex_args { + syscallarg(void *) uaddr; + syscallarg(int) futex_op; + syscallarg(int) val; + syscallarg(const struct timespec *) tp; + syscallarg(int *) uaddr2; + syscallarg(int) val3; +}; + /* * System call prototypes. */ @@ -1347,3 +1356,4 @@ int sys_symlinkat(struct proc *, void *, intsys_unlinkat(struct proc *, void *, register_t *); intsys___set_tcb(struct proc *, void *, register_t *); intsys___get_tcb(struct proc *, void *, register_t *); +intsys_futex(struct proc *, void *, register_t *); -- Michal Mazurek

Better wording in ping error messages

2016-09-02 Thread Michal Mazurek
); if (setsockopt(s, SOL_SOCKET, SO_RTABLE, &rtableid, sizeof(rtableid)) == -1) err(1, "setsockopt SO_RTABLE"); -- Michal Mazurek

Re: Better wording in ping error messages

2016-09-02 Thread Michal Mazurek
On 12:12:11, 2.09.16, Ted Unangst wrote: > Michal Mazurek wrote: > > worms(6) does this more concisely: > > > > errx(1, "length (2-1024) is %s: %s", errstr, > > there's multiple schools of thought here, but i've always preferred somewhat >

Mention the maximum packet size in ping.8

2016-09-02 Thread Michal Mazurek
@@ -176,6 +176,7 @@ Specifies the number of data bytes to be The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data. +The maximum packet size is 65467. .It Fl T Ar toskeyword Change IPv4 TOS value. .Ar toskeyword -- Michal Mazurek

Remove mention of deprecated flags in ping6.8

2016-09-02 Thread Michal Mazurek
It Fl v -- Michal Mazurek

thrsleep: remove ticket lock support

2016-09-03 Thread Michal Mazurek
LOCK_UPTIME 5 #if __BSD_VISIBLE -#define__CLOCK_USE_TICKET_LOCKS8 /* flag for __thrsleep() */ - /* * Per-process and per-thread clocks encode the PID or TID into the * high bits, with the type in the bottom bits -- Michal Mazurek

Re: thrsleep: remove ticket lock support

2016-09-03 Thread Michal Mazurek
- @@ -39,8 +39,6 @@ #define CLOCK_UPTIME 5 #if __BSD_VISIBLE -#define__CLOCK_USE_TICKET_LOCKS8 /* flag for __thrsleep() */ - /* * Per-process and per-thread clocks encode the PID or TID into the * high bits, with the type in the bottom bits -- Michal Mazurek

Mention the maximum packet size in ping6.8

2016-09-03 Thread Michal Mazurek
r outgoing packets. .It Fl v -- Michal Mazurek

Remove _USING_TICKETS from librthreads

2016-09-03 Thread Michal Mazurek
rror = __thrsleep(self, 0 | _USING_TICKETS, NULL, - &mutex->lock.ticket, &self->delayed_cancel); + error = __thrsleep(self, 0, NULL, &mutex->lock.ticket, + &self->delayed_cancel); /* * If we took a normal signal (not from -- Michal Mazurek

__thrsleep.2 tweak

2016-09-03 Thread Michal Mazurek
clock_gettime 2 +clock id. .El .Pp .Fn __thrwakeup -- Michal Mazurek

Remove tickets from librthreads

2016-09-03 Thread Michal Mazurek
lf, 0, NULL, &mutex->lock.ticket, + error = __thrsleep(self, 0, NULL, &mutex->lock, &self->delayed_cancel); /* Index: lib/librthread/rthread_tls.c === RCS file:

Re: Futexes for OpenBSD

2016-09-04 Thread Michal Mazurek
7 @@ DASM= ${ASM:.o=.do} # syscalls that CANNOT FAIL. They can return whatever value they want, # they just never want to set errno. ASM_NOERR=__get_tcb.o __set_tcb.o __threxit.o __thrsleep.o __thrwakeup.o \ + futex.o \ getdtablecount.o getegid.o geteuid.o getgid.o getlogin_r.o \ getpgrp.o getpid.o getppid.o getrtable.o getthrid.o getuid.o \ issetugid.o \ -- Michal Mazurek

mount(8): strlen + malloc + snprintf == asprintf

2016-09-04 Thread Michal Mazurek
== NULL) + if (asprintf(&cp, "%s,%s", s0, s1) == -1) err(1, NULL); - (void)snprintf(cp, i, "%s,%s", s0, s1); } else cp = strdup(s1); free(s0); - return (cp); + return cp; } void -- Michal Mazurek

mount(8): remove unneeded headers

2016-09-07 Thread Michal Mazurek
#include "pathnames.h" -- Michal Mazurek

config(8): strlen + emalloc + snprintf = asprintf

2016-09-07 Thread Michal Mazurek
(&p, "../compile/%s", last_component) == -1) + err(1, NULL); } defbuilddir = (argc == 0) ? "." : p; -- Michal Mazurek

STANDARDS in err.3

2016-09-14 Thread Michal Mazurek
1.20 +++ lib/libc/gen/err.3 14 Sep 2016 07:28:26 - @@ -189,6 +189,10 @@ if ((fd = open(block_device, O_RDONLY, 0 .Xr perror 3 , .Xr printf 3 , .Xr strerror 3 +.Sh STANDARDS +These functions are +.Bx +extensions. .Sh HISTORY The functions .Fn err , -- Michal Mazurek

ps.1 tweak

2016-10-06 Thread Michal Mazurek
16 19:24:51 - @@ -543,7 +543,7 @@ If set to a positive integer, output is formatted to the given width in columns. Otherwise, .Nm -defaults to the terminal width \(mi 1, +defaults to the terminal width \(mi1, or 79 columns if none of .Dv stdout , .Dv stderr -- Michal Mazurek

Re: ps.1 tweak

2016-10-06 Thread Michal Mazurek
1, or 79 columns if none of .Dv stdout , .Dv stderr -- Michal Mazurek

faq4.html: loading firmware during install

2016-12-09 Thread Michal Mazurek
drive in /mnt and reload the interface: + + +ifconfig iwm0 down +ifconfig iwm0 up + + +And then unmount the drive. + + +Be aware that the installer uses /mnt to copy the +distribution sets to disk, and thus loading the firmware must be +performed before it is started. -- Michal Mazurek

loadfirmware.9: mention /mnt/etc/firmware

2016-12-20 Thread Michal Mazurek
in the directory .Pa /etc/firmware . +In addition to that, if the kernel is a ramdisk kernel, the extra +directory +.Pa /mnt/etc/firmware +will also be used for the lookup. Memory for the firmware is allocated using .Xr malloc 9 with type -- Michal Mazurek

sleep.1: "while true;" -> "while :;"

2016-12-20 Thread Michal Mazurek
o ls -l file sleep 5 done -- Michal Mazurek

Re: sleep.1: "while true;" -> "while :;"

2016-12-21 Thread Michal Mazurek
On 22:49:38, 20.12.16, Jason McIntyre wrote: > On Tue, Dec 20, 2016 at 10:58:40PM +0100, Michal Mazurek wrote: > > While there is nothing wrong with "while true", "while :" is better > > and used a lot more often in the source tree. > > > > OK? &g

Clarify factor(6)

2015-12-26 Thread Michal Mazurek
a number is factored, it is printed and the list of factors on a single line. Factors are listed in ascending order, and are preceded by a space. If a factor divides a value more than once, it will be printed -more than once. +that number of times. .Pp When .Nm -- Michal Mazurek

Mention lang/go and lang/rust in faq8.html

2015-12-26 Thread Michal Mazurek
@ -430,6 +438,14 @@ Plenty of subpackages are available for Ruby http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/ruby";>lang/ruby + + + + + +Rust + +http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/rust";>lang/rust -- Michal Mazurek

Potential null pointer dereference in malloc.c if 'A' is cleared

2015-12-29 Thread Michal Mazurek
aid, since the core file represents the time of failure, rather than when the bogus pointer was used. +.It Cm a +.Dq Never Abort . +Never call +.Xr abort 3 , +even if +.Dq xmalloc +or +.Dq Junk +is set. .It Cm C .Dq Canaries . Add canaries at the end of allocations in order to detect Th

Add C11 stdalign.h and stdnoreturn.h

2015-12-30 Thread Michal Mazurek
RCS file: include/stdnoreturn.h diff -N include/stdnoreturn.h --- /dev/null 1 Jan 1970 00:00:00 - +++ include/stdnoreturn.h 30 Dec 2015 16:43:53 - @@ -0,0 +1,12 @@ +/* $OpenBSD$ */ + +/* + * Public domain. + */ + +#ifndef_STDNORETURN_H_ +#define _STDNORETURN_H_ + +#define noreturn _Noreturn + +#endif /* _STDNORETURN_H_ */ -- Michal Mazurek

Clarify vmctl(8) console

2015-12-31 Thread Michal Mazurek
It Cm create Ar path Fl s Ar size Creates a VM disk image file with the specified -- Michal Mazurek

A cleanup block for virtio.c vionet_notifyq()

2015-12-31 Thread Michal Mazurek
"%d", errno); - free(pkt); - free(vr); - return (0); + goto out; } ret = 1; @@ -1170,6 +1158,7 @@ vionet_notifyq(struct vionet_dev *dev) log_warnx("vionet: tx error writing vio ring"); } +out: free(vr); free(pkt); -- Michal Mazurek

Mark some functions as static in vmd.c

2016-01-01 Thread Michal Mazurek
t, const char *); struct vmd_vm *vm_getbyvmid(uint32_t); struct vmd_vm *vm_getbyid(uint32_t); struct vmd_vm *vm_getbyname(const char *); -- Michal Mazurek

Don't declare main() in pax, adventure, battlestar

2016-01-01 Thread Michal Mazurek
battlestar.c --- games/battlestar/battlestar.c 4 Dec 2015 17:34:40 - 1.18 +++ games/battlestar/battlestar.c 1 Jan 2016 15:28:07 - @@ -40,8 +40,6 @@ #include "extern.h" #include "pathnames.h" -int main(int, char *[]); - int main(int argc, char *argv

OpenBSDVMM58 -> OpenBSDVMM59 in vmmvar.h

2016-01-01 Thread Michal Mazurek
@@ #ifndef _MACHINE_VMMVAR_H_ #define _MACHINE_VMMVAR_H_ -#define VMM_HV_SIGNATURE "OpenBSDVMM58" +#define VMM_HV_SIGNATURE "OpenBSDVMM59" #define VMM_MAX_DISKS_PER_VM 2 #define VMM_MAX_PATH_DISK 128 -- Michal Mazurek

unused proc_ispeer() in proc.c

2016-01-02 Thread Michal Mazurek
struct privsep_proc *procs, unsigned int nproc) -- Michal Mazurek

vmd.h typo in comment (VMM_DEBUG -> VMD_DEBUG)

2016-01-02 Thread Michal Mazurek
dprintf(x...) do { log_debug(x); } while(0) #else #define dprintf(x...) -#endif /* VMM_DEBUG */ +#endif /* VMD_DEBUG */ enum imsg_type { IMSG_VMDOP_START_VM_REQUEST = IMSG_PROC_MAX, -- Michal Mazurek

Don't declare main() in fsck, fsck_msdos, fsdb, ncheck_ffs

2016-01-02 Thread Michal Mazurek
- @@ -119,7 +119,6 @@ int matchino(const void *, const void *) int matchcache(const void *, const void *); void cacheino(ufsino_t, void *); void *cached(ufsino_t); -int main(int, char *[]); char *rawname(char *); void format_entry(const char *, struct direct *); -- Michal Mazurek

Clarify fold(1)

2016-01-04 Thread Michal Mazurek
XIT STATUS .Ex -std fold -- Michal Mazurek

HISTORY and AUTHORS for rs(1), lam(1), jot(1)

2016-01-04 Thread Michal Mazurek
jot.1 20 Jan 2014 05:07:48 - 1.18 +++ jot/jot.1 4 Jan 2016 19:56:51 - @@ -313,3 +313,10 @@ To print all lines 80 characters or long .Xr yes 1 , .Xr arc4random 3 , .Xr printf 3 +.Sh HISTORY +The +.Nm +utility first appeared in +.Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze -- M

Re: Clarify fold(1)

2016-01-04 Thread Michal Mazurek
width column positions (or bytes). +If a space character does not exist within the width, then +a longer line will still be split at the width. .It Fl w Ar width Specifies a line width to use instead of the default 80 characters. .El -- Michal Mazurek

pf.conf.5: mention the inversion (!) operator

2017-05-15 Thread Michal Mazurek
" redirhost-list "}" ) -[ portspec ] [ pooltype ] [ "static-port" ] | -[ route ] | [ "set tos" tos ] | -[ [ "!" ] "received-on" ( interface-name | interface-group ) ] + "af-to" af "from" ( redirhost | "{" redirhost-list "}" ) + [ "to" ( redirhost | "{" redirhost-list "}" ) ] | + "binat-to" ( redirhost | "{" redirhost-list "}" ) + [ portspec ] [ pooltype ] | + "rdr-to" ( redirhost | "{" redirhost-list "}" ) + [ portspec ] [ pooltype ] | + "nat-to" ( redirhost | "{" redirhost-list "}" ) + [ portspec ] [ pooltype ] [ "static-port" ] | + [ route ] | [ "set tos" tos ] | + [ [ "!" ] "received-on" ( interface-name | interface-group ) ] scrubopts = scrubopt [ [ "," ] scrubopts ] scrubopt = "no-df" | "min-ttl" number | "max-mss" number | -- Michal Mazurek

Re: pf.conf.5: mention the inversion (!) operator

2017-05-18 Thread Michal Mazurek
rt" ] | -[ route ] | [ "set tos" tos ] | - [ [ "!" ] "received-on" ( interface-name | interface-group ) ] + "af-to" af "from" ( redirhost | "{" redirhost-list "}" ) + [ "to" ( redirhost | "{" redirhost-list "}" ) ] | + "binat-to" ( redirhost | "{" redirhost-list "}" ) + [ portspec ] [ pooltype ] | + "rdr-to" ( redirhost | "{" redirhost-list "}" ) + [ portspec ] [ pooltype ] | + "nat-to" ( redirhost | "{" redirhost-list "}" ) + [ portspec ] [ pooltype ] [ "static-port" ] | + [ route ] | [ "set tos" tos ] | + [ [ "!" ] "received-on" ( interface-name | interface-group ) ] scrubopts = scrubopt [ [ "," ] scrubopts ] scrubopt = "no-df" | "min-ttl" number | "max-mss" number | -- Michal Mazurek

Re: pf.conf.5: mention the inversion (!) operator

2017-05-19 Thread Michal Mazurek
On 07:52:28, 19.05.17, Jason McIntyre wrote: > On Fri, May 19, 2017 at 08:34:54AM +0200, Michal Mazurek wrote: > > Now that it was commited, what remains is to convert tabs to spaces inside > > a > > literal block: > > > > morning. > > what's the

Add interface groups for dhcpd, fix whitespaces

2011-05-27 Thread Michal Mazurek
+ if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + err(1, "SIOCGIFGROUP"); -ifg = ifgr.ifgr_groups; -for (; ifg && len >= sizeof(struct ifg_req); ifg++) { -len -= sizeof(struct ifg_req); + ifg = ifgr.i

Re: Add interface groups for dhcpd, fix whitespaces

2011-05-27 Thread Michal Mazurek
ifg = ifgr.ifgr_groups; + for (; ifg && len >= sizeof(struct ifg_req); ifg++) { + len -= sizeof(struct ifg_req); + if (strcmp(ifg->ifgrq_group, groupname) == 0) { + ret = 1; + break; + } + } + free(ifgr.ifgr_groups); + +end: + close(s); + return (ret); } -- Michal Mazurek

rtadvd crashes after multiple ifconfig create/destroy

2011-05-28 Thread Michal Mazurek
for (ifm = (struct if_msghdr *)buf; ifm < (struct if_msghdr *)lim;) { + if (ifm->ifm_type == RTM_IFINFO) { + if (ifm->ifm_version == RTM_VERSION) { + (*ifmlist_p)[ifm->ifm_index] = ifm; + }

Re: rtadvd crashes after multiple ifconfig create/destroy

2011-06-05 Thread Michal Mazurek
On Sat, May 28, 2011 at 01:25:15PM +0200, Michal Mazurek wrote: > After multiple ifconfig create and destroy of bridge and tun interfaces rtadvd > crashed just seconds after being started. Here is a way to recreate the crash: $ cat /etc/rtadvd.conf tun6:addr="fd00:1234::1":prefi

Mention available filesystem types for disklabel somewhere

2013-04-06 Thread Michal Mazurek
available filesystem types see the fstypenames table in +.Pa /usr/include/sys/disklabel.h . The editor commands are as follows: .Bl -tag -width "p [unit] " .It Cm \&? \*(Ba h -- Michal Mazurek

Invalid parenthesis placement in stdlibs malloc.c

2012-09-13 Thread Michal Mazurek
wrterror("mapalign bad alignment", NULL); return MAP_FAILED; } -- Michal Mazurek

strlcat usage in realpath.c

2012-09-13 Thread Michal Mazurek
ENAMETOOLONG; goto err; -- Michal Mazurek

missing description for strtod(3)

2012-09-14 Thread Michal Mazurek
space 3 function) are skipped. .Sh RETURN VALUES -- Michal Mazurek

missing argument in vaccess.9

2012-09-14 Thread Michal Mazurek
scribed by .Fa acc_mode , based on the +.Fa type , .Fa file_mode , .Fa uid , and -- Michal Mazurek

mention vdrop in vhold.9

2012-09-14 Thread Michal Mazurek
ess than or equal to zero prior to calling +.Fn vdrop , +the system will panic. +If the vnode is no longer referenced, it will be freed. .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS -- Michal Mazurek

Re: mention vdrop in vhold.9

2012-09-15 Thread Michal Mazurek
ecrements the +.Va v_holdcnt +of the vnode. +If the holdcount is zero prior to calling +.Fn vdrop , +the system will panic. +If the vnode is no longer referenced, it will be freed. .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS -- Michal Mazurek

<    1   2