Skip to Main Content

sys/machlock.h: where is lock_t defined?

user13806071Jun 15 2017 — edited Jul 4 2017

On a Solaris 10 box with Developer studio 12.5, I get the following error when I try to compile a simple C program below

cc toto.c

"toto.c", line 1: invalid directive

"/usr/include/sys/machlock.h", line 40: syntax error before or at: disp_lock_t

cc: acomp failed for toto.c

test.c:

#inclcude <stdlib.h>

#include <stdio.h>

#include <sys/stropts.h>

int main(int argc, char *argv[])

{

        printf("Hello world\n");

}

Header files includes /usr/include/sys/machlock.h which has at line 40

typedef  lock_t   disp_lock_t;  /* dispatcher lock type */

I have checked that header files are installed, It must be something obvious, I am hoping somebody has seen that one before.

Comments
Post Details
Added on Jun 15 2017
9 comments
419 views