Re: POSIX semaphore for GNU/Hurd

2002-11-19 Thread Michal 'hramrach' Suchanek
Sending what I have so far. Hopefully I'll be able to read any comments next wek. On Thu, Nov 07, 2002 at 10:22:09AM -0500, Neal H. Walfield wrote: > > > not conform to the GNU coding standards; this will have to be fixed. It probably still does not, I'll have to read the GCS carefully when I have

Re: POSIX semaphore for GNU/Hurd

2002-11-07 Thread Michal 'hramrach' Suchanek
On Wed, Nov 06, 2002 at 08:59:30PM -0500, Neal H. Walfield wrote: > > I tried to make it return errno and be async-cancel resistant. > > Why do you want it to be async-cancel resistant? The functions are > not defined as being async-cancel safe; only pthread_cancel, > pthread_setcancelstate and p

Re: POSIX semaphore for GNU/Hurd

2002-11-06 Thread Michal 'hramrach' Suchanek
On Sun, Oct 27, 2002 at 06:06:08PM +0100, Ga?l Le Mignot wrote: > > Hello, > > While trying to compile abiword, and so gnome-vfs, on GNU/Hurd, I've > seen that it uses POSIX semaphore, that we don't implement yet. > > So, I've done an implementation of POSIX semaphores using a pthread_mutex > an

Re: POSIX semaphore for GNU/Hurd

2002-11-02 Thread Neal H. Walfield
> int > sem_init (sem_t *sem, int pshared, unsigned int value) > { > if (pshared) > return -1; Set errno to ENOTSUP. > sem = malloc (sizeof (*sem)); > if (sem == NULL) > return -1; This is not going to work at all. SEM is a local variable; If you are going to continue with this m

Re: POSIX semaphore for GNU/Hurd

2002-11-02 Thread Neal H. Walfield
It seems I overlooked this attachment in my last email. Sorry. > #ifndef _SEMAPHORE_H > #define _SEMAPHORE_H 1 > > #include POSIX says you must include and . > > __BEGIN_DECLS > > struct __sem_t > { > unsigned int count; > pthread_mutex_t count_lock; > pthread_cond_t lock; > }; Th

Re: POSIX semaphore for GNU/Hurd

2002-11-02 Thread Neal H. Walfield
> > int > > sem_init (sem_t *sem, int pshared, unsigned int value) > > { > > if (pshared) > > return -1; > > If you wanted to be consistant with LinuxThreads this should be > if (pshared) > { > errno = ENOSYS; > return -1; > } > However, I think it would be better to actually

Re: POSIX semaphore for GNU/Hurd

2002-10-27 Thread James Morrison
--- Ga�l Le Mignot <[EMAIL PROTECTED]> wrote: > > Sun, 27 Oct 2002 20:10:24 +0100, tu as dit : > >>> if (pshared) > >>> return -1; > > >> If you wanted to be consistant with LinuxThreads this should be > >> if (pshared) > >> { > >> errno = ENOSYS; > >> return -1; > >> } > > > I know

Re: POSIX semaphore for GNU/Hurd

2002-10-27 Thread Gaël Le Mignot
Sun, 27 Oct 2002 20:10:24 +0100, tu as dit : >>> if (pshared) >>> return -1; >> If you wanted to be consistant with LinuxThreads this should be >> if (pshared) >> { >> errno = ENOSYS; >> return -1; >> } > I know we should do that, but ooops ! I forgot to finish my sentence. What I wa

Re: POSIX semaphore for GNU/Hurd

2002-10-27 Thread Gaël Le Mignot
Sun, 27 Oct 2002 10:57:08 -0800 (PST), tu as dit : >> Hello, >> >> While trying to compile abiword, and so gnome-vfs, on GNU/Hurd, I've >> seen that it uses POSIX semaphore, that we don't implement yet.> >> So, I've done an implementation of POSIX semaphores using a pthread_mutex >> and

Re: POSIX semaphore for GNU/Hurd

2002-10-27 Thread James Morrison
--- Ga�l Le Mignot <[EMAIL PROTECTED]> wrote: > > Hello, > > While trying to compile abiword, and so gnome-vfs, on GNU/Hurd, I've > seen that it uses POSIX semaphore, that we don't implement yet.> > So, I've done an implementation of POSIX semaphores using a pthread_mutex > and a pthread_con

POSIX semaphore for GNU/Hurd

2002-10-27 Thread Gaël Le Mignot
Hello, While trying to compile abiword, and so gnome-vfs, on GNU/Hurd, I've seen that it uses POSIX semaphore, that we don't implement yet. So, I've done an implementation of POSIX semaphores using a pthread_mutex and a pthread_cond. I didn't test it yet, but it compiles, and I'm pretty confiden