s3:torture: call fault_setup() to get usage backtraces
[Samba/gebeck_regimport.git] / lib / util / system.c
blob558aa5bc12125769e564bdb623caea2cf8ae1c1a
1 /*
2 Unix SMB/CIFS implementation.
3 Samba system utilities
4 Copyright (C) Andrew Tridgell 1992-1998
5 Copyright (C) Jeremy Allison 1998-2002
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "includes.h"
22 #include "system/network.h"
23 #include "system/filesys.h"
25 #undef malloc
28 The idea is that this file will eventually have wrappers around all
29 important system calls in samba. The aims are:
31 - to enable easier porting by putting OS dependent stuff in here
33 - to allow for hooks into other "pseudo-filesystems"
35 - to allow easier integration of things like the japanese extensions
37 - to support the philosophy of Samba to expose the features of
38 the OS within the SMB model. In general whatever file/printer/variable
39 expansions/etc make sense to the OS should be acceptable to Samba.
43 _PUBLIC_ int sys_getnameinfo(const struct sockaddr *psa,
44 int salen,
45 char *host,
46 size_t hostlen,
47 char *service,
48 size_t servlen,
49 int flags)
52 * For Solaris we must make sure salen is the
53 * correct length for the incoming sa_family.
56 if (salen == sizeof(struct sockaddr_storage)) {
57 salen = sizeof(struct sockaddr_in);
58 #if defined(HAVE_IPV6)
59 if (psa->sa_family == AF_INET6) {
60 salen = sizeof(struct sockaddr_in6);
62 #endif
64 return getnameinfo(psa, salen, host, hostlen, service, servlen, flags);