Changeset b7fd2a0 in mainline for uspace/lib/c/include/ipc/ipc.h


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/ipc.h

    r36f0738 rb7fd2a0  
    4646#include <abi/cap.h>
    4747
    48 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
     48typedef void (*ipc_async_callback_t)(void *, errno_t, ipc_call_t *);
    4949
    50 extern int ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
     50extern errno_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
    5151extern void ipc_poke(void);
    5252
     
    5454        ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
    5555
    56 extern int ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
    57 extern int ipc_trywait_for_call(ipc_call_t *);
     56extern errno_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
     57extern errno_t ipc_trywait_for_call(ipc_call_t *);
    5858
    5959/*
     
    7878            (arg5))
    7979
    80 extern int ipc_answer_fast(cap_handle_t, int, sysarg_t, sysarg_t,
     80extern errno_t ipc_answer_fast(cap_handle_t, errno_t, sysarg_t, sysarg_t,
    8181    sysarg_t, sysarg_t);
    82 extern int ipc_answer_slow(cap_handle_t, int, sysarg_t, sysarg_t,
     82extern errno_t ipc_answer_slow(cap_handle_t, errno_t, sysarg_t, sysarg_t,
    8383    sysarg_t, sysarg_t, sysarg_t);
    8484
     
    115115    sysarg_t, sysarg_t, sysarg_t, void *, ipc_async_callback_t);
    116116
    117 extern int ipc_hangup(cap_handle_t);
     117extern errno_t ipc_hangup(cap_handle_t);
    118118
    119 extern int ipc_forward_fast(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
     119extern errno_t ipc_forward_fast(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
    120120    sysarg_t, unsigned int);
    121 extern int ipc_forward_slow(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
     121extern errno_t ipc_forward_slow(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
    122122    sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
    123123
    124 extern int ipc_connect_kbox(task_id_t, cap_handle_t *);
     124extern errno_t ipc_connect_kbox(task_id_t, cap_handle_t *);
    125125
    126126#endif
Note: See TracChangeset for help on using the changeset viewer.