Print this page
NEX-16818 Add fksmbcl development tool
NEX-17264 SMB client test tp_smbutil_013 fails after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
and: (fix ref leaks)
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/fs/smbclnt/netsmb/smb_osdep.h
+++ new/usr/src/uts/common/fs/smbclnt/netsmb/smb_osdep.h
1 -#pragma ident "%Z%%M% %I% %E% SMI"
1 +/*
2 + * Copyright (c) 2001 - 2012 Apple Inc. All rights reserved.
3 + *
4 + * @APPLE_LICENSE_HEADER_START@
5 + *
6 + * This file contains Original Code and/or Modifications of Original Code
7 + * as defined in and that are subject to the Apple Public Source License
8 + * Version 2.0 (the 'License'). You may not use this file except in
9 + * compliance with the License. Please obtain a copy of the License at
10 + * http://www.opensource.apple.com/apsl/ and read it before using this
11 + * file.
12 + *
13 + * The Original Code and all software distributed under the License are
14 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 + * Please see the License for the specific language governing rights and
19 + * limitations under the License.
20 + *
21 + * @APPLE_LICENSE_HEADER_END@
22 + */
2 23
3 24 /*
4 25 * Code corresponding to smb_apple.h
5 - * XXX: Could merge this into smb_subr.h
6 - * as long as that doesn't break smbfs
7 26 */
8 27
9 28 #ifndef _NETSMB_SMB_OSDEP_H_
10 29 #define _NETSMB_SMB_OSDEP_H_
11 30
12 31 #ifndef PRIVSYM
13 -#define PRIVSYM
32 +#define PRIVSYM
14 33 #endif
15 34
16 35 #ifndef min
17 36 #define min(a, b) (((a) < (b)) ? (a) : (b))
18 37 #endif
19 38
20 39 #define CAST_DOWN(type, addr) (((type)((uintptr_t)(addr))))
21 40 #define USER_ADDR_NULL ((user_addr_t)0)
22 41 #define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)(a_ptr))
23 42
24 43 /*
25 44 * flags to (BSD) malloc
26 45 */
27 46 #define M_WAITOK 0x0000
28 47 #define M_NOWAIT 0x0001
29 48 #define M_ZERO 0x0004 /* bzero the allocation */
30 49
31 50 /* Iconv stuff */
32 51
33 52 /*
34 53 * Some UTF Related stuff. Will be deleting this once compiled and using
35 54 * ienup's code.
36 55 */
37 56 /*
38 57 * UTF-8 encode/decode flags
39 58 */
40 59 #define UTF_REVERSE_ENDIAN 0x01 /* reverse UCS-2 byte order */
41 60 #define UTF_NO_NULL_TERM 0x02 /* do not add null termination */
42 61 #define UTF_DECOMPOSED 0x04 /* generate fully decomposed UCS-2 */
43 62 #define UTF_PRECOMPOSED 0x08 /* generate precomposed UCS-2 */
44 63
45 64 /*
46 65 * These are actually included in sunddi.h. I am getting compilation
47 66 * errors right now. Adding the induvidual defines here again from sunddi.h
48 67 * Unicode encoding conversion functions and their macros.
49 68 */
50 69 #define UCONV_IN_BIG_ENDIAN 0x0001
51 70 #define UCONV_OUT_BIG_ENDIAN 0x0002
52 71 #define UCONV_IN_SYSTEM_ENDIAN 0x0004
53 72 #define UCONV_OUT_SYSTEM_ENDIAN 0x0008
54 73 #define UCONV_IN_LITTLE_ENDIAN 0x0010
55 74 #define UCONV_OUT_LITTLE_ENDIAN 0x0020
56 75 #define UCONV_IGNORE_NULL 0x0040
57 76 #define UCONV_IN_ACCEPT_BOM 0x0080
|
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
58 77 #define UCONV_OUT_EMIT_BOM 0x0100
59 78
60 79 extern int uconv_u8tou16(const uchar_t *, size_t *, uint16_t *, size_t *, int);
61 80
62 81 /* Legacy type names for Solaris. */
63 82 typedef uint64_t u_int64_t;
64 83 typedef uint32_t u_int32_t;
65 84 typedef uint16_t u_int16_t;
66 85 typedef uint8_t u_int8_t;
67 86
68 -typedef const char * c_caddr_t;
87 +typedef const char *c_caddr_t;
69 88 typedef uint64_t user_addr_t;
89 +typedef ssize_t user_ssize_t;
90 +typedef size_t user_size_t;
70 91
92 +#ifdef _FAKE_KERNEL
93 +#define ddi_get_cred() CRED()
94 +#endif
95 +
71 96 /*
72 97 * Time related calls.
73 98 */
74 99
75 100 /* BEGIN CSTYLED */
76 101 #define timespeccmp(tvp, uvp, cmp) \
77 102 (((tvp)->tv_sec == (uvp)->tv_sec) ? \
78 103 ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \
79 104 ((tvp)->tv_sec cmp (uvp)->tv_sec))
80 105 /* END CSTYLED */
81 106
82 107 #define timespecadd(vvp, uvp) \
83 108 { \
84 109 (vvp)->tv_sec += (uvp)->tv_sec; \
85 110 (vvp)->tv_nsec += (uvp)->tv_nsec; \
86 111 if ((vvp)->tv_nsec >= 1000000000) { \
87 112 (vvp)->tv_sec++; \
88 113 (vvp)->tv_nsec -= 1000000000; \
89 114 } \
90 115 }
91 116
92 117 #define timespecsub(vvp, uvp) \
93 118 { \
94 119 (vvp)->tv_sec -= (uvp)->tv_sec; \
95 120 (vvp)->tv_nsec -= (uvp)->tv_nsec; \
96 121 if ((vvp)->tv_nsec < 0) { \
97 122 (vvp)->tv_sec--; \
98 123 (vvp)->tv_nsec += 1000000000; \
99 124 } \
100 125 }
101 126
102 127 #endif /* _NETSMB_SMB_OSDEP_H_ */
|
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX