uiomove and mutex

2010-01-11 Thread H.Fazaeli
dear gurus man mutex(9) states that: "No mutexes should be held (except for Giant) across functions which access memory in userspace, such as copyin(9), copyout(9), uiomove(9), fuword(9), etc. No locks are needed when calling these functions." can someone pls. explain why it is so? Suppose I

Re: CopyOut Size Limits

2008-04-25 Thread H.fazaeli
Do not allocate my_type (in general, big data structures) on kernel stack (e.g, use malloc(9)). Adam wrote: Hi, I am writing a custom system call that needs to transfer 16kb of data from the kernel to userspace. I am transferring the data out of the kernel by using copyout. This seems to wor

Re: how to write a raw socket server using UDP

2007-11-28 Thread H.fazaeli
the 2 most common cause for sendto() failure on raw sockets are: - badly initialized IP header. note that ip_len and ip_off must be in host byte order. all other fields must be in net byte order. - badly initialized destination address. writing a raw socket server is not much different than ot