This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sem_getvalue


Hi,

I use shapshot April 5 2001.

In packages/compat/posix/current/src/sem.cxx file
there is function:

externC int sem_getvalue  (sem_t *sem, int *sval)
{
    int retval;
    SEMA_ENTRY();
    Cyg_Counting_Semaphore *sema = (Cyg_Counting_Semaphore *)sem;
    retval = sema->peek();
    CYG_REPORT_RETVAL( retval );
    return retval;
}

I think that it wrong.

And the following is correct:

externC int sem_getvalue  (sem_t *sem, int *sval)
{
    int retval;
    SEMA_ENTRY();
    Cyg_Counting_Semaphore *sema = (Cyg_Counting_Semaphore *)sem;
    *sval = sema->peek();
    CYG_REPORT_RETVAL( retval );
    return 0;
}

That's right?

--
Boris Guzhov,
St.Petersburg, Russia



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]