Changeset 988 for vendor/current/source3/include/includes.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/includes.h
r740 r988 23 23 #include "../replace/replace.h" 24 24 25 #if _SAMBA_BUILD_ == 426 # undef _SAMBA_BUILD_27 # define _SAMBA_BUILD_ 328 #endif29 30 25 /* make sure we have included the correct config.h */ 31 26 #ifndef NO_CONFIG_H /* for some tests */ … … 143 138 #endif 144 139 145 /* mutually exclusive (SuSE 8.2) */146 #if HAVE_ATTR_XATTR_H147 #include <attr/xattr.h>148 #elif HAVE_SYS_XATTR_H149 #include <sys/xattr.h>150 #endif151 152 #ifdef HAVE_SYS_EA_H153 #include <sys/ea.h>154 #endif155 156 #ifdef HAVE_SYS_EXTATTR_H157 #include <sys/extattr.h>158 #endif159 160 140 #ifdef HAVE_SYS_UIO_H 161 141 #include <sys/uio.h> … … 168 148 #if HAVE_NETGROUP_H 169 149 #include <netgroup.h> 170 #endif171 172 #if defined(HAVE_AIO_H) && defined(WITH_AIO)173 #include <aio.h>174 150 #endif 175 151 … … 202 178 203 179 /* 204 Samba needs type definitions for int16, int32, uint16 and uint32.205 206 Normally these are signed and unsigned 16 and 32 bit integers, but207 they actually only need to be at least 16 and 32 bits208 respectively. Thus if your word size is 8 bytes just defining them209 as signed and unsigned int will work.210 */211 212 #ifndef uint8213 #define uint8 uint8_t214 #endif215 216 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)217 # define int16 int16_t218 /* needed to work around compile issue on HP-UX 11.x */219 # define _INT16 1220 #endif221 222 /*223 * Note we duplicate the size tests in the unsigned224 * case as int16 may be a typedef from rpc/rpc.h225 */226 227 228 #if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)229 # define uint16 uint16_t230 #endif231 232 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)233 # define int32 int32_t234 # ifndef _INT32235 /* needed to work around compile issue on HP-UX 11.x */236 # define _INT32 1237 # endif238 #endif239 240 /*241 * Note we duplicate the size tests in the unsigned242 * case as int32 may be a typedef from rpc/rpc.h243 */244 245 #if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)246 # define uint32 uint32_t247 #endif248 249 /*250 * check for 8 byte long long251 */252 253 #if !defined(uint64)254 # define uint64 uint64_t255 #endif256 257 #if !defined(int64)258 # define int64 int64_t259 #endif260 261 262 /*263 180 * Types for devices, inodes and offsets. 264 181 */ 265 182 266 183 #ifndef SMB_DEV_T 267 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T) 268 # define SMB_DEV_T dev64_t 269 # else 270 # define SMB_DEV_T dev_t 271 # endif 184 # define SMB_DEV_T dev_t 272 185 #endif 273 186 274 187 #ifndef LARGE_SMB_DEV_T 275 # if (defined( HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))188 # if (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8)) 276 189 # define LARGE_SMB_DEV_T 1 277 190 # endif … … 291 204 292 205 #ifndef SMB_INO_T 293 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)294 # define SMB_INO_T ino64_t295 # else296 206 # define SMB_INO_T ino_t 297 # endif298 207 #endif 299 208 300 209 #ifndef LARGE_SMB_INO_T 301 # if (defined( HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8))210 # if (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8)) 302 211 # define LARGE_SMB_INO_T 1 303 212 # endif … … 312 221 #endif 313 222 314 #ifndef SMB_OFF_T315 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)316 # define SMB_OFF_T off64_t317 # else318 # define SMB_OFF_T off_t319 # endif320 #endif321 322 223 /* TODO: remove this macros */ 323 224 #define SBIG_UINT(p, ofs, v) SBVAL(p, ofs, v) … … 328 229 typedef uint64_t br_off; 329 230 330 #define SMB_OFF_T_BITS (sizeof( SMB_OFF_T)*8)231 #define SMB_OFF_T_BITS (sizeof(off_t)*8) 331 232 332 233 /* … … 335 236 */ 336 237 337 #ifndef LARGE_SMB_OFF_T338 # if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8))339 # define LARGE_SMB_OFF_T 1340 # endif341 #endif342 343 #ifdef LARGE_SMB_OFF_T344 238 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) 345 239 #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32)) 346 #define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) ))) 347 #else 348 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) 349 #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0)) 350 #define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF ))) 351 #endif 352 353 #ifndef HAVE_BLKSIZE_T 354 /* This is mainly for HP/UX which defines st_blksize as long */ 355 typedef long blksize_t; 356 #endif 357 358 #ifndef HAVE_BLKCNT_T 359 /* This is mainly for HP/UX which doesn't have blkcnt_t */ 360 typedef long blkcnt_t; 361 #endif 240 #define IVAL_TO_SMB_OFF_T(buf,off) ((off_t)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) ))) 362 241 363 242 /* … … 385 264 uint32_t st_ex_flags; 386 265 uint32_t st_ex_mask; 387 388 /*389 * Add space for VFS internal extensions. The initial user of this390 * would be the onefs modules, passing the snapid from the stat calls391 * to the file_id_create call. Maybe we'll have to expand this later,392 * but the core of Samba should never look at this field.393 */394 uint64_t vfs_private;395 266 }; 396 267 397 268 typedef struct stat_ex SMB_STRUCT_STAT; 398 399 /*400 * Type for dirent structure.401 */402 403 #ifndef SMB_STRUCT_DIRENT404 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIRENT64)405 # define SMB_STRUCT_DIRENT struct dirent64406 # else407 # define SMB_STRUCT_DIRENT struct dirent408 # endif409 #endif410 411 /*412 * Type for DIR structure.413 */414 415 #ifndef SMB_STRUCT_DIR416 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIR64)417 # define SMB_STRUCT_DIR DIR64418 # else419 # define SMB_STRUCT_DIR DIR420 # endif421 #endif422 423 /*424 * Defines for 64 bit fcntl locks.425 */426 427 #ifndef SMB_STRUCT_FLOCK428 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)429 # define SMB_STRUCT_FLOCK struct flock64430 # else431 # define SMB_STRUCT_FLOCK struct flock432 # endif433 #endif434 435 #ifndef SMB_F_SETLKW436 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)437 # define SMB_F_SETLKW F_SETLKW64438 # else439 # define SMB_F_SETLKW F_SETLKW440 # endif441 #endif442 443 #ifndef SMB_F_SETLK444 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)445 # define SMB_F_SETLK F_SETLK64446 # else447 # define SMB_F_SETLK F_SETLK448 # endif449 #endif450 451 #ifndef SMB_F_GETLK452 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)453 # define SMB_F_GETLK F_GETLK64454 # else455 # define SMB_F_GETLK F_GETLK456 # endif457 #endif458 459 /*460 * Type for aiocb structure.461 */462 463 #ifndef SMB_STRUCT_AIOCB464 # if defined(WITH_AIO)465 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_AIOCB64)466 # define SMB_STRUCT_AIOCB struct aiocb64467 # else468 # define SMB_STRUCT_AIOCB struct aiocb469 # endif470 # else471 # define SMB_STRUCT_AIOCB int /* AIO not being used but we still need the define.... */472 # endif473 #endif474 269 475 270 enum timestamp_set_resolution { … … 503 298 #endif 504 299 300 /* debug.h need to be included before samba_util.h for the macro SMB_ASSERT */ 301 #include "../lib/util/debug.h" 302 505 303 /* Lists, trees, caching, database... */ 506 #include "../lib/util/ util.h"304 #include "../lib/util/samba_util.h" 507 305 #include "../lib/util/util_net.h" 508 306 #include "../lib/util/xfile.h" … … 518 316 #include "../lib/util/data_blob.h" 519 317 #include "../lib/util/time.h" 520 #include "../lib/util/debug.h"521 318 #include "../lib/util/debug_s3.h" 522 319 … … 524 321 #include "../libcli/util/error.h" 525 322 #include "../lib/util/charset/charset.h" 526 #include "dynconfig .h"323 #include "dynconfig/dynconfig.h" 527 324 #include "locking.h" 528 325 #include "smb_perfcount.h" … … 530 327 #include "../lib/util/byteorder.h" 531 328 532 #include " module.h"329 #include "../lib/util/samba_modules.h" 533 330 #include "../lib/util/talloc_stack.h" 534 331 #include "../lib/util/smb_threads.h" 535 332 #include "../lib/util/smb_threads_internal.h" 536 333 334 /* samba_setXXid functions. */ 335 #include "../lib/util/setid.h" 336 537 337 /***** prototypes *****/ 538 338 #ifndef NO_PROTO_H … … 540 340 #endif 541 341 342 #include "lib/param/loadparm.h" 343 542 344 /* String routines */ 543 345 … … 553 355 #endif 554 356 555 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)556 #define OSF1_ENH_SEC 1557 #endif558 357 559 358 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID) … … 580 379 581 380 #define MAX_SEC_CTX_DEPTH 8 /* Maximum number of security contexts */ 582 583 584 #ifdef GLIBC_HACK_FCNTL64585 /* this is a gross hack. 64 bit locking is completely screwed up on586 i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack587 "fixes" the problem with the current 2.4.0test kernels588 */589 #define fcntl fcntl64590 #undef F_SETLKW591 #undef F_SETLK592 #define F_SETLK 13593 #define F_SETLKW 14594 #endif595 381 596 382 … … 604 390 605 391 /* PRINTFLIKE2 */ 606 void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);607 608 /* PRINTFLIKE2 */609 392 int fstr_sprintf(fstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); 610 611 int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);612 393 613 394 int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); … … 624 405 #endif 625 406 626 #ifndef XATTR_CREATE627 #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */628 #endif629 630 #ifndef XATTR_REPLACE631 #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */632 #endif633 634 407 #ifdef TRUE 635 408 #undef TRUE … … 649 422 #endif 650 423 651 #ifndef CONST_DISCARD652 #define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr)))653 #endif654 655 void smb_panic( const char *why ) _NORETURN_;656 424 void dump_core(void) _NORETURN_; 657 425 void exit_server(const char *const reason) _NORETURN_; 658 426 void exit_server_cleanly(const char *const reason) _NORETURN_; 659 void exit_server_fault(void) _NORETURN_;660 661 /* samba3 doesn't use uwrap yet */662 #define uwrap_enabled() 0663 427 664 428 #define BASE_RID (0x000003E8L)
Note:
See TracChangeset
for help on using the changeset viewer.