Annotation of libaitrpc/src/aitrpc.c, revision 1.1.1.1.2.1
1.1 misho 1: /*************************************************************************
2: * (C) 2010 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com>
3: * by Michael Pounov <misho@openbsd-bg.org>
4: *
5: * $Author: misho $
1.1.1.1.2.1! misho 6: * $Id: aitrpc.c,v 1.1.1.1 2010/06/18 01:48:06 misho Exp $
1.1 misho 7: *
8: *************************************************************************/
9: #include "global.h"
10:
11:
12: #pragma GCC visibility push(hidden)
13:
14: // ------------------------------------------------
15:
1.1.1.1.2.1! misho 16: pthread_mutex_t rpc_mtx;
! 17: int rpc_Kill;
! 18:
1.1 misho 19: int rpc_Errno;
20: char rpc_Error[STRSIZ];
21:
22: #pragma GCC visibility pop
23:
24: // rpc_GetErrno() Get error code of last operation
25: inline int
26: rpc_GetErrno()
27: {
28: return rpc_Errno;
29: }
30:
31: // rpc_GetError() Get error text of last operation
32: inline const char *
33: rpc_GetError()
34: {
35: return rpc_Error;
36: }
37:
38: // rpc_SetErr() Set error to variables for internal use!!!
39: inline void
40: rpc_SetErr(int eno, char *estr, ...)
41: {
42: va_list lst;
43:
44: rpc_Errno = eno;
45: memset(rpc_Error, 0, STRSIZ);
46: va_start(lst, estr);
47: vsnprintf(rpc_Error, STRSIZ, estr, lst);
48: va_end(lst);
49: }
50:
51: // ------------------------------------------------------------
52:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>