/src/samba/lib/util/system.c
Line | Count | Source |
1 | | /* |
2 | | Unix SMB/CIFS implementation. |
3 | | Samba system utilities |
4 | | Copyright (C) Andrew Tridgell 1992-1998 |
5 | | Copyright (C) Jeremy Allison 1998-2002 |
6 | | |
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. |
11 | | |
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. |
16 | | |
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/>. |
19 | | */ |
20 | | |
21 | | #include "includes.h" |
22 | | #include "system/network.h" |
23 | | #include "system/filesys.h" |
24 | | |
25 | | #undef malloc |
26 | | |
27 | | /* |
28 | | The idea is that this file will eventually have wrappers around all |
29 | | important system calls in samba. The aims are: |
30 | | |
31 | | - to enable easier porting by putting OS dependent stuff in here |
32 | | |
33 | | - to allow for hooks into other "pseudo-filesystems" |
34 | | |
35 | | - to allow easier integration of things like the japanese extensions |
36 | | |
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. |
40 | | */ |
41 | | |
42 | | |
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) |
50 | 0 | { |
51 | | /* |
52 | | * For Solaris we must make sure salen is the |
53 | | * correct length for the incoming sa_family. |
54 | | */ |
55 | |
|
56 | 0 | if (salen == sizeof(struct sockaddr_storage)) { |
57 | 0 | salen = sizeof(struct sockaddr_in); |
58 | 0 | #if defined(HAVE_IPV6) |
59 | 0 | if (psa->sa_family == AF_INET6) { |
60 | 0 | salen = sizeof(struct sockaddr_in6); |
61 | 0 | } |
62 | 0 | #endif |
63 | 0 | } |
64 | 0 | return getnameinfo(psa, salen, host, hostlen, service, servlen, flags); |
65 | 0 | } |