ctypesminix

Missing type information in parameters in MINIX 3 (v3.1.0)


In kernel/proto.h, MINIX 3 defines two forward declarations struct proc and struct timer. However much of the type information within the parameters is missing. Examples such as clock_t,U16_t,tmr_func_t, and message are totally missing. There does not seem to be any #include statements in the file either, so how is the compiler not complaining?


Solution

  • Look in kernel/kernel.h, where it is clear that order of inclusion of some of the header files is important.

    /* Important kernel header files. */
    #include "config.h"     /* configuration, MUST be first */
    #include "const.h"      /* constants, MUST be second */
    #include "type.h"       /* type definitions, MUST be third */
    #include "proto.h"      /* function prototypes */
    #include "glo.h"        /* global variables */
    #include "ipc.h"        /* IPC constants */
    #include "debug.h"      /* debugging, MUST be last kernel header */
    

    Not every header file will include every other header file that it depends on. Learn to use your local search tools. Also, a google search for clock_t would probably be instructive. Most of the others you mentioned, don't appear to be standard C library types.