mailing list of musl libc
 help / color / mirror / code / Atom feed
* posix api test
@ 2012-10-20 22:04 Szabolcs Nagy
  2012-10-21 23:17 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2012-10-20 22:04 UTC (permalink / raw)
  To: musl

i have ugly scripts to generate the posix coverage tables
but i thought it's worth creating .c files for each
posix .h and let the compiler do the checks

i put the code into my test repo for now
http://nsz.repo.hu/git/?p=libc-test;a=tree;f=src/api

(most of [OB] interfaces are not included, but most optional stuff are)

and the errors found:

fcntl.c:29: error: 'O_TTY_INIT' undeclared (first use in this function)
fmtmsg.c:2:20: error: fmtmsg.h: No such file or directory
ndbm.c:1:18: error: ndbm.h: No such file or directory
netdb.c:60: error: 'NI_NUMERICSCOPE' undeclared (first use in this function)
pthread.c:73: error: 'pthread_cleanup_pop' undeclared (first use in this function)
pthread.c:74: error: 'pthread_cleanup_push' undeclared (first use in this function)
pthread.c:91: error: 'pthread_getschedparam' undeclared (first use in this function)
pthread.c:98: error: 'pthread_mutex_getprioceiling' undeclared (first use in this function)
pthread.c:101: error: 'pthread_mutex_setprioceiling' undeclared (first use in this function)
pthread.c:131: error: 'pthread_setschedparam' undeclared (first use in this function)
pthread.c:132: error: 'pthread_setschedprio' undeclared (first use in this function)
pthread.c:144: error: 'pthread_getcpuclockid' undeclared (first use in this function)
sched.c:20: error: 'SCHED_SPORADIC' undeclared (first use in this function)
spawn.c:43: error: 'posix_spawnattr_getschedparam' undeclared (first use in this function)
spawn.c:44: error: 'posix_spawnattr_getschedpolicy' undeclared (first use in this function)
spawn.c:45: error: 'posix_spawnattr_setschedparam' undeclared (first use in this function)
spawn.c:46: error: 'posix_spawnattr_setschedpolicy' undeclared (first use in this function)
stdlib.c:22: error: 'WNOHANG' undeclared (first use in this function)
stdlib.c:25: error: 'WUNTRACED' undeclared (first use in this function)
sys_sem.c:21: error: initialization from incompatible pointer type
	struct semid_ds x; unsigned short *p = &x.sem_nsems;
sys_shm.c:7: error: 'shmatt_t' undeclared (first use in this function)
sys_shm.c:20: error: 'y' undeclared (first use in this function)
	struct shmid_ds x; shmatt_t *y = &x.shm_nattch;
sys_types.c:21: error: initialization makes pointer from integer without a cast
	timer_t x = 1;
unistd.c:29: error: '_CS_POSIX_V7_THREADS_CFLAGS' undeclared (first use in this function)
unistd.c:30: error: '_CS_POSIX_V7_THREADS_LDFLAGS' undeclared (first use in this function)
unistd.c:32: error: '_CS_V7_ENV' undeclared (first use in this function)
unistd.c:59: error: '_PC_TIMESTAMP_RESOLUTION' undeclared (first use in this function)
unistd.c:180: error: '_SC_XOPEN_UUCP' undeclared (first use in this function)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: posix api test
  2012-10-20 22:04 posix api test Szabolcs Nagy
@ 2012-10-21 23:17 ` Rich Felker
  2012-10-22  4:15   ` Isaac Dunham
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2012-10-21 23:17 UTC (permalink / raw)
  To: musl

On Sun, Oct 21, 2012 at 12:04:44AM +0200, Szabolcs Nagy wrote:
> i have ugly scripts to generate the posix coverage tables
> but i thought it's worth creating .c files for each
> posix .h and let the compiler do the checks
> 
> i put the code into my test repo for now
> http://nsz.repo.hu/git/?p=libc-test;a=tree;f=src/api

Very nice.

> (most of [OB] interfaces are not included, but most optional stuff are)
> 
> and the errors found:
> 
> fcntl.c:29: error: 'O_TTY_INIT' undeclared (first use in this function)

Waiting on a value to be assigned for it...
This one's really a pain since the O_* constants are per-arch.

> fmtmsg.c:2:20: error: fmtmsg.h: No such file or directory

Ugly mess I'm not looking forward to.

> ndbm.c:1:18: error: ndbm.h: No such file or directory

My feeling is that dbm stuff will stay in an external third-party
library.

> netdb.c:60: error: 'NI_NUMERICSCOPE' undeclared (first use in this function)

Also waiting on a decision for the value; glibc folks are
non-responsive.

> pthread.c:73: error: 'pthread_cleanup_pop' undeclared (first use in this function)
> pthread.c:74: error: 'pthread_cleanup_push' undeclared (first use in this function)

Seem to be errors in POSIX.

> pthread.c:91: error: 'pthread_getschedparam' undeclared (first use in this function)
> pthread.c:98: error: 'pthread_mutex_getprioceiling' undeclared (first use in this function)
> pthread.c:101: error: 'pthread_mutex_setprioceiling' undeclared (first use in this function)
> pthread.c:131: error: 'pthread_setschedparam' undeclared (first use in this function)
> pthread.c:132: error: 'pthread_setschedprio' undeclared (first use in this function)
> pthread.c:144: error: 'pthread_getcpuclockid' undeclared (first use in this function)
> sched.c:20: error: 'SCHED_SPORADIC' undeclared (first use in this function)
> spawn.c:43: error: 'posix_spawnattr_getschedparam' undeclared (first use in this function)
> spawn.c:44: error: 'posix_spawnattr_getschedpolicy' undeclared (first use in this function)
> spawn.c:45: error: 'posix_spawnattr_setschedparam' undeclared (first use in this function)
> spawn.c:46: error: 'posix_spawnattr_setschedpolicy' undeclared (first use in this function)

All optonal.

> stdlib.c:22: error: 'WNOHANG' undeclared (first use in this function)
> stdlib.c:25: error: 'WUNTRACED' undeclared (first use in this function)

Fixed, I hope.

> sys_sem.c:21: error: initialization from incompatible pointer type
> 	struct semid_ds x; unsigned short *p = &x.sem_nsems;
> sys_shm.c:7: error: 'shmatt_t' undeclared (first use in this function)
> sys_shm.c:20: error: 'y' undeclared (first use in this function)
> 	struct shmid_ds x; shmatt_t *y = &x.shm_nattch;

Still need to look at these.

> sys_types.c:21: error: initialization makes pointer from integer without a cast
> 	timer_t x = 1;

Unfortunately glibc also defines it as a pointer type (void *).

> unistd.c:29: error: '_CS_POSIX_V7_THREADS_CFLAGS' undeclared (first use in this function)
> unistd.c:30: error: '_CS_POSIX_V7_THREADS_LDFLAGS' undeclared (first use in this function)
> unistd.c:32: error: '_CS_V7_ENV' undeclared (first use in this function)
> unistd.c:59: error: '_PC_TIMESTAMP_RESOLUTION' undeclared (first use in this function)
> unistd.c:180: error: '_SC_XOPEN_UUCP' undeclared (first use in this function)

I think glibc is also missing these, at least in the old version I'm
looking at. We'll need to get agreed-upon values. Hopefully a newer
glibc has them for me to pull..

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: posix api test
  2012-10-21 23:17 ` Rich Felker
@ 2012-10-22  4:15   ` Isaac Dunham
  0 siblings, 0 replies; 3+ messages in thread
From: Isaac Dunham @ 2012-10-22  4:15 UTC (permalink / raw)
  To: musl

On Sun, 21 Oct 2012 19:17:25 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> 
> > unistd.c:29: error: '_CS_POSIX_V7_THREADS_CFLAGS' undeclared (first use in this function)
Not in eglibc trunk (see bits/confname.h)
newlib uses 18, fwiw
> > unistd.c:30: error: '_CS_POSIX_V7_THREADS_LDFLAGS' undeclared (first use in this function)
Likewise.
newlib uses 19.
> > unistd.c:32: error: '_CS_V7_ENV' undeclared (first use in this function)
Tail end of an enum...
> > unistd.c:59: error: '_PC_TIMESTAMP_RESOLUTION' undeclared (first use in this function)
> > unistd.c:180: error: '_SC_XOPEN_UUCP' undeclared (first use in this function)
Don't appear to be defined.

> I think glibc is also missing these, at least in the old version I'm
> looking at. We'll need to get agreed-upon values. Hopefully a newer
> glibc has them for me to pull..


-- 
Isaac Dunham <idunham@lavabit.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-22  4:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-20 22:04 posix api test Szabolcs Nagy
2012-10-21 23:17 ` Rich Felker
2012-10-22  4:15   ` Isaac Dunham

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).