Re: pthread2lwp API

2016-04-23 Thread Martin Husemann
On Sat, Apr 23, 2016 at 02:58:16AM +0200, Kamil Rytarowski wrote: > Alternatively adding support for pthread_getcpuclockid() + using > clock_gettime(3) would approximate the result (as it's done for Linux > and FreeBSD). That is a lot cleaner, though the Posix description of pthread_getcpuclockid

Re: pthread2lwp API

2016-04-23 Thread Christos Zoulas
In article <20160423124132.gc2...@mail.duskware.de>, Martin Husemann wrote: >On Sat, Apr 23, 2016 at 02:58:16AM +0200, Kamil Rytarowski wrote: >> Alternatively adding support for pthread_getcpuclockid() + using >> clock_gettime(3) would approximate the result (as it's done for Linux >> and FreeBS

Re: pthread2lwp API

2016-04-23 Thread Martin Husemann
On Sat, Apr 23, 2016 at 12:53:15PM +, Christos Zoulas wrote: > >That is a lot cleaner, though the Posix description of > >pthread_getcpuclockid is not explaining the semantics of that clock (or > >I am overlooking it?) > > This is not hard to do... Yes but I was wondering if the "cpu" in the

Re: pthread2lwp API

2016-04-23 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 23.04.2016 15:01, Martin Husemann wrote: > On Sat, Apr 23, 2016 at 12:53:15PM +, Christos Zoulas wrote: >>> That is a lot cleaner, though the Posix description of >>> pthread_getcpuclockid is not explaining the semantics of that >>> clock (or

Re: pthread2lwp API

2016-04-23 Thread Martin Husemann
On Sat, Apr 23, 2016 at 03:17:40PM +0200, Kamil Rytarowski wrote: > The pthread_getcpuclockid() function shall return in clock_id the > clock ID of the CPU-time clock of the thread specified by thread_id, > if the thread specified by thread_id exists. And what does "the CPU-time clock" mean? Mart

Re: pthread2lwp API

2016-04-23 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 23.04.2016 15:19, Martin Husemann wrote: > On Sat, Apr 23, 2016 at 03:17:40PM +0200, Kamil Rytarowski wrote: >> The pthread_getcpuclockid() function shall return in clock_id >> the clock ID of the CPU-time clock of the thread specified by >> threa

sem_open(2) and ENAMETOOLONG

2016-04-23 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 The sem_open(2) function call reports an error for a too long name and sets errno: [ENAMETOOLONG] The name argument is too long. I noted in the kernel that the limit is SEM_MAX_NAMELEN: do_ksem_open(struct lwp *l, const char *semname, int ofla

Re: sem_open(2) and ENAMETOOLONG

2016-04-23 Thread David Holland
On Sat, Apr 23, 2016 at 06:06:10PM +0200, Kamil Rytarowski wrote: > The sem_open(2) function call reports an error for a too long name and > sets errno: > > [ENAMETOOLONG] The name argument is too long. ...as it should. > The limit is held privately in the kernel: > > sys/kern/uipc_s

Re: sem_open(2) and ENAMETOOLONG

2016-04-23 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 23.04.2016 20:55, David Holland wrote: > On Sat, Apr 23, 2016 at 06:06:10PM +0200, Kamil Rytarowski wrote: >> The sem_open(2) function call reports an error for a too long >> name and sets errno: >> >> [ENAMETOOLONG] The name argument is too

Re: sem_open(2) and ENAMETOOLONG

2016-04-23 Thread David Holland
On Sat, Apr 23, 2016 at 10:42:52PM +0200, Kamil Rytarowski wrote: > >> I read in the POSIX resources that the limit is defined by > >> PATH_MAX or its variation: > >> > >> ENAMETOOLONG The length of the name argument exceeds {PATH_MAX} > >> or a pathname component is longer than {NAME_MAX}.

Re: sem_open(2) and ENAMETOOLONG

2016-04-23 Thread David Holland
On Sat, Apr 23, 2016 at 09:12:43PM +, David Holland wrote: > > >> Additionally I noted that SEM_VALUE_MAX is defined at least twice > > >> in the code-base, in and sys/kern/uipc_sem.c > > >> (thankfully with the same value: ~0U). > > > > > > That would be a bug. > > namely: pleas

Re: sem_open(2) and ENAMETOOLONG

2016-04-23 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 23.04.2016 23:52, David Holland wrote: > On Sat, Apr 23, 2016 at 09:12:43PM +, David Holland wrote: > Additionally I noted that SEM_VALUE_MAX is defined at least > twice in the code-base, in and > sys/kern/uipc_sem.c (thankfully w