Skip to content
Snippets Groups Projects
NuttxUserGuide.html 102 KiB
Newer Older
patacongo's avatar
patacongo committed
    struct timespec
    {
      time_t tv_sec;  /* Seconds */
      long   tv_nsec; /* Nanoseconds */
    };
</PRE>

<H3>3.4.4 struct mq_attr</H3>

<P>
This structure is used to communicate message queue attributes
between Nuttx and a MoBY application:
<PRE>
    struct mq_attr {
      size_t       mq_maxmsg;   /* Max number of messages in queue */
      size_t       mq_msgsize;  /* Max message size */
      unsigned     mq_flags;    /* Queue flags */
      size_t       mq_curmsgs;  /* Number of messages currently in queue */
    };
</PRE>

<H3>3.4.5 struct sigaction</H3>

<P>
The following structure defines the action to take for given signal:
<PRE>
    struct sigaction
    {
      union
      {
        void (*_sa_handler)(int);
        void (*_sa_sigaction)(int, siginfo_t *, void *);
patacongo's avatar
patacongo committed
      } sa_u;
      sigset_t           sa_mask;
      int                sa_flags;
    };
    #define sa_handler   sa_u._sa_handler
    #define sa_sigaction sa_u._sa_sigaction
</PRE>

<H3>3.4.6 struct siginfo/siginfo_t</H3>

<P>
The following types is used to pass parameters to/from signal
handlers:
<PRE>
    typedef struct siginfo
    {
      int          si_signo;
      int          si_code;
      union sigval si_value;
   } siginfo_t;
</PRE>

<H3>3.4.7 union sigval</H3>

<P>
This defines the type of the struct siginfo si_value field and
is used to pass parameters with signals.
<PRE>
    union sigval
    {
      int   sival_int;
      void *sival_ptr;
    };
</PRE>

<H3>3.4.8 struct sigevent</H3>

<P>
The following is used to attach a signal to a message queue to
notify a task when a message is available on a queue.
<PRE>
    struct sigevent
    {
      int          sigev_signo;
      union sigval sigev_value;
      int          sigev_notify;
    };
</PRE>

<H3>3.4.9 Watchdog Data Types</H3>

<p>
  When a watchdog expires, the callback function with this
  type is called:
</p>
<pre>
    typedef void (*wdentry_t)(int argc, ...);
</pre>
<p>
  Where argc is the number of uint32 type arguments that follow.
</p>
  The arguments are passed as uint32 values.
  For systems where the sizeof(pointer) &lt; sizeof(uint32), the
  following union defines the alignment of the pointer within the
  uint32.  For example, the SDCC MCS51 general pointer is
  24-bits, but uint32 is 32-bits (of course).
</p>
<pre>
    union wdparm_u
    {
      void   *pvarg;
      uint32 *dwarg;
    };
    typedef union wdparm_u wdparm_t;
</pre>
<p>
  For most 32-bit systems, pointers and uint32 are the same size
  For systems where sizeof(pointer) > sizeof(uint32), we will
  have to do some redesign.
</p>

patacongo's avatar
patacongo committed
</BODY>
</HTML>