Print this page
9704 move socket functions to libc
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libc/inc/libc.h
+++ new/usr/src/lib/libc/inc/libc.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 /*
28 28 * This is where all the interfaces that are internal to libc
29 29 * which do not have a better home live
30 30 */
31 31
32 32 #ifndef _LIBC_H
33 33 #define _LIBC_H
34 34
35 35 #include <thread.h>
36 36 #include <stdio.h>
37 37 #include <dirent.h>
38 38 #include <ucontext.h>
39 39 #include <nsswitch.h>
40 40 #include <stddef.h>
41 41 #include <poll.h>
42 42 #include <sys/dl.h>
43 43 #include <sys/door.h>
44 44 #include <sys/ieeefp.h>
45 45 #include <sys/mount.h>
46 46 #include <floatingpoint.h>
47 47 #include <nl_types.h>
48 48 #include <regex.h>
49 49 #include <stdarg.h>
50 50 #include <wchar.h>
51 51 #include <wctype.h>
52 52 #include <libnvpair.h>
53 53
54 54 #ifdef __cplusplus
55 55 extern "C" {
56 56 #endif
57 57
58 58 extern void __set_panicstr(const char *);
59 59 extern void _rewind_unlocked(FILE *);
60 60 extern long _sysconfig(int);
61 61 extern int kill(pid_t pid, int sig);
62 62
63 63 extern int primary_link_map;
64 64 extern int thr_main(void);
65 65 extern int thr_kill(thread_t tid, int sig);
66 66 extern thread_t thr_self(void);
67 67 extern int mutex_lock(mutex_t *mp);
68 68 extern int mutex_unlock(mutex_t *mp);
69 69 extern void callout_lock_enter(void);
70 70 extern void callout_lock_exit(void);
71 71 extern void *lmalloc(size_t);
72 72 extern void lfree(void *, size_t);
73 73 extern void libc_nvlist_free(nvlist_t *);
74 74 extern int libc_nvlist_lookup_uint64(nvlist_t *, const char *, uint64_t *);
75 75 extern void *libc_malloc(size_t);
76 76 extern void *libc_realloc(void *, size_t);
77 77 extern void libc_free(void *);
78 78 extern char *libc_strdup(const char *);
79 79 extern int _pollsys(struct pollfd *, nfds_t, const timespec_t *,
80 80 const sigset_t *);
81 81
82 82 /*
83 83 * The private_DIR structure is the same as the DIR structure,
84 84 * with the addition of a mutex lock for libc's internal use.
85 85 */
86 86 typedef struct {
87 87 DIR dd_dir;
88 88 mutex_t dd_lock;
89 89 } private_DIR;
90 90
91 91 #if !defined(_LP64)
92 92 /*
93 93 * getdents64 transitional interface is intentionally internal to libc
94 94 */
95 95 extern int getdents64(int, struct dirent64 *, size_t);
96 96 #endif
97 97
98 98 extern int _scrwidth(wchar_t);
99 99
100 100 extern int64_t __div64(int64_t, int64_t);
101 101 extern int64_t __rem64(int64_t, int64_t);
102 102 extern uint64_t __udiv64(uint64_t, uint64_t);
103 103 extern uint64_t __urem64(uint64_t, uint64_t);
104 104 extern int64_t __mul64(int64_t, int64_t);
105 105 extern uint64_t __umul64(uint64_t, uint64_t);
106 106
107 107
108 108 /*
109 109 * Rounding direction functions
110 110 */
111 111 #if defined(__i386) || defined(__amd64)
112 112 extern enum fp_direction_type __xgetRD(void);
113 113 #elif defined(__sparc)
114 114 extern enum fp_direction_type _QgetRD(void);
115 115 #else
116 116 #error Unknown architecture!
117 117 #endif
118 118
119 119 /*
120 120 * defined in open.c
121 121 */
122 122 extern int __open(const char *, int, mode_t);
123 123 extern int __open64(const char *, int, mode_t);
124 124 extern int __openat(int, const char *, int, mode_t);
125 125 extern int __openat64(int, const char *, int, mode_t);
126 126
127 127 /*
128 128 * defined in hex_bin.c
129 129 */
130 130 extern void __hex_to_single(decimal_record *, enum fp_direction_type,
131 131 single *, fp_exception_field_type *);
132 132 extern void __hex_to_double(decimal_record *, enum fp_direction_type,
133 133 double *, fp_exception_field_type *);
134 134 #if defined(__sparc)
135 135 extern void __hex_to_quadruple(decimal_record *, enum fp_direction_type,
136 136 quadruple *, fp_exception_field_type *);
137 137 #elif defined(__i386) || defined(__amd64)
138 138 extern void __hex_to_extended(decimal_record *, enum fp_direction_type,
139 139 extended *, fp_exception_field_type *);
140 140 #else
141 141 #error Unknown architecture
142 142 #endif
143 143
144 144 /*
145 145 * defined in ctime.c
146 146 */
147 147 extern char *__posix_asctime_r(const struct tm *, char *);
148 148
149 149 /*
150 150 * Internal routine from fsync.c
151 151 */
152 152 extern int __fdsync(int, int); /* 2nd arg may be wrong in 64bit mode */
153 153
154 154 /*
155 155 * Internal routine from _xregs_clrptr.c
156 156 */
157 157 extern void _xregs_clrptr(ucontext_t *);
158 158
159 159 /*
160 160 * Internal routine from nfssys.c
161 161 */
162 162 extern int _nfssys(int, void *); /* int in 64bit mode ???, void * ??? */
163 163
164 164 /*
165 165 * Internal routine from psetsys.c
166 166 */
167 167 extern int _pset(int, ...); /* int in 64bit mode ??? */
168 168
169 169 /*
170 170 * defined in sigpending.s
171 171 */
172 172 extern int __sigfillset(sigset_t *);
173 173
174 174 /*
175 175 * defined in sparc/fp/_Q_set_except.c and i386/fp/exception.c
176 176 */
177 177 extern int _Q_set_exception(unsigned int);
178 178
179 179 /*
180 180 * defined in nsparse.c
181 181 */
182 182 extern struct __nsw_switchconfig *_nsw_getoneconfig(const char *name,
183 183 char *linep, enum __nsw_parse_err *);
184 184 extern struct __nsw_switchconfig_v1 *_nsw_getoneconfig_v1(const char *name,
185 185 char *linep, enum __nsw_parse_err *);
186 186
187 187 /*
188 188 * Internal routine from getusershell.c
189 189 */
190 190 extern char *getusershell(void);
191 191
192 192 /*
↓ open down ↓ |
192 lines elided |
↑ open up ↑ |
193 193 * defined in _sigaction.s
194 194 */
195 195 extern int __sigaction(int, const struct sigaction *, struct sigaction *);
196 196
197 197 /*
198 198 * defined in _getsp.s
199 199 */
200 200 extern greg_t _getsp(void);
201 201
202 202 /*
203 - * defined in _so_setsockopt.s
204 - */
205 -extern int _so_setsockopt(int, int, int, const char *, int);
206 -
207 -/*
208 - * defined in _so_getsockopt.s
209 - */
210 -extern int _so_getsockopt(int, int, int, char *, int *);
211 -
212 -/*
213 203 * defined in lsign.s
214 204 */
215 205 extern int lsign(dl_t);
216 206
217 207 /*
218 208 * defined in ucontext.s
219 209 */
220 210 extern int __getcontext(ucontext_t *);
221 211
222 212 /*
223 213 * defined in door.s
224 214 */
225 215 extern int __door_info(int, door_info_t *);
226 216 extern int __door_call(int, door_arg_t *);
227 217
228 218 /*
229 219 * defined in _portfs.s
230 220 */
231 221 extern int64_t _portfs(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t,
232 222 uintptr_t);
233 223
234 224 /*
235 225 * defined in xpg4.c
236 226 */
237 227 extern int __xpg4; /* global */
238 228 extern int libc__xpg4; /* copy of __xpg4, private to libc */
239 229
240 230 /*
241 231 * defined in xpg6.c
242 232 */
243 233 extern uint_t __xpg6; /* global */
244 234 extern uint_t libc__xpg6; /* copy of __xpg6, private to libc */
245 235
246 236 /*
247 237 * defined in port/stdio/doscan.c
248 238 */
249 239 extern int _doscan(FILE *, const char *, va_list);
250 240 extern int __doscan_u(FILE *, const char *, va_list, int);
251 241 extern int __wdoscan_u(FILE *, const wchar_t *, va_list, int);
252 242
253 243 #ifndef _LP64
254 244 /* Flag for _ndoprnt() and _doscan_u() */
255 245 #define _F_INTMAX32 0x1 /* if set read 4 bytes for u/intmax %j */
256 246 extern int _fprintf_c89(FILE *, const char *, ...);
257 247 extern int _printf_c89(const char *, ...);
258 248 extern int _snprintf_c89(char *, size_t, const char *, ...);
259 249 extern int _sprintf_c89(char *, const char *, ...);
260 250 extern int _wprintf_c89(const wchar_t *, ...);
261 251 extern int _fwprintf_c89(FILE *, const wchar_t *, ...);
262 252 extern int _swprintf_c89(wchar_t *, size_t, const wchar_t *, ...);
263 253 extern int _vfprintf_c89(FILE *, const char *, va_list);
264 254 extern int _vprintf_c89(const char *, va_list);
265 255 extern int _vsnprintf_c89(char *, size_t, const char *, va_list);
266 256 extern int _vsprintf_c89(char *, const char *, va_list);
267 257 extern int _vwprintf_c89(const wchar_t *, va_list);
268 258 extern int _vfwprintf_c89(FILE *, const wchar_t *, va_list);
269 259 extern int _vswprintf_c89(wchar_t *, size_t, const wchar_t *, va_list);
270 260 extern int _scanf_c89(const char *, ...);
271 261 extern int _fscanf_c89(FILE *, const char *, ...);
272 262 extern int _sscanf_c89(const char *, const char *, ...);
273 263 extern int _vscanf_c89(const char *, va_list);
274 264 extern int _vfscanf_c89(FILE *, const char *, va_list);
275 265 extern int _vsscanf_c89(const char *, const char *, va_list);
276 266 extern int _vwscanf_c89(const wchar_t *, va_list);
277 267 extern int _vfwscanf_c89(FILE *, const wchar_t *, va_list);
278 268 extern int _vswscanf_c89(const wchar_t *, const wchar_t *, va_list);
279 269 extern int _wscanf_c89(const wchar_t *, ...);
280 270 extern int _fwscanf_c89(FILE *, const wchar_t *, ...);
281 271 extern int _swscanf_c89(const wchar_t *, const wchar_t *, ...);
282 272 #endif /* _LP64 */
283 273
284 274 /*
285 275 * defined in port/stdio/popen.c
286 276 */
287 277 extern int _insert(pid_t pid, int fd);
288 278 extern pid_t _delete(int fd);
289 279
290 280 /*
291 281 * defined in port/print/doprnt.c
292 282 */
293 283 extern ssize_t _wdoprnt(const wchar_t *, va_list, FILE *);
294 284
295 285 /*
296 286 * defined in fgetwc.c
297 287 */
298 288 extern wint_t _fgetwc_unlocked(FILE *);
299 289 extern wint_t __getwc_xpg5(FILE *);
300 290 extern wint_t __fgetwc_xpg5(FILE *);
301 291 extern wint_t _getwc(FILE *);
302 292
303 293 /*
304 294 * defined in fputwc.c
305 295 */
306 296 extern wint_t __putwc_xpg5(wint_t, FILE *);
307 297 extern wint_t _putwc(wint_t, FILE *);
308 298
309 299 /*
310 300 * defined in ungetwc.c
311 301 */
312 302 extern wint_t __ungetwc_xpg5(wint_t, FILE *);
313 303
314 304 /*
315 305 * Defined in setlocale.c.
316 306 */
317 307 extern char *current_locale(locale_t, int);
318 308
319 309 #ifdef __cplusplus
320 310 }
321 311 #endif
322 312
323 313 #endif /* _LIBC_H */
↓ open down ↓ |
101 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX