Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/mman.h
          +++ new/usr/src/uts/common/sys/mman.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  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  /* Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved. */
  23   23  /*
       24 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       25 + *
  24   26   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  25   27   * Use is subject to license terms.
  26   28   */
  27   29  
  28   30  /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
  29   31  /*        All Rights Reserved   */
  30   32  
  31   33  /*
  32   34   * University Copyright- Copyright (c) 1982, 1986, 1988
  33   35   * The Regents of the University of California
↓ open down ↓ 180 lines elided ↑ open up ↑
 214  216  #ifdef __PRAGMA_REDEFINE_EXTNAME
 215  217  #pragma redefine_extname        getpagesizes    getpagesizes2
 216  218  #else
 217  219  #define getpagesizes    getpagesizes2
 218  220  #endif
 219  221  
 220  222  /*
 221  223   * Except for old binaries mmap() will return the resultant
 222  224   * address of mapping on success and (caddr_t)-1 on error.
 223  225   */
 224      -#ifdef  __STDC__
 225  226  #if (_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
 226  227  extern void *mmap(void *, size_t, int, int, int, off_t);
 227  228  extern int munmap(void *, size_t);
 228  229  extern int mprotect(void *, size_t, int);
 229  230  extern int msync(void *, size_t, int);
 230  231  #if (!defined(_XPG4_2) || (_POSIX_C_SOURCE > 2)) || defined(__EXTENSIONS__)
 231  232  extern int mlock(const void *, size_t);
 232  233  extern int munlock(const void *, size_t);
 233  234  #endif  /* (!defined(_XPG4_2) || (_POSIX_C_SOURCE > 2))... */
 234  235  /* transitional large file interface version */
↓ open down ↓ 34 lines elided ↑ open up ↑
 269  270  extern int shm_unlink(const char *);
 270  271  #endif
 271  272  
 272  273  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
 273  274  extern int posix_madvise(void *, size_t, int);
 274  275  #endif
 275  276  
 276  277  /* mmap failure value */
 277  278  #define MAP_FAILED      ((void *) -1)
 278  279  
 279      -#else   /* __STDC__ */
 280      -extern caddr_t mmap();
 281      -extern int munmap();
 282      -extern int mmapobj();
 283      -extern int mprotect();
 284      -extern int mincore();
 285      -extern int memcntl();
 286      -extern int msync();
 287      -extern int madvise();
 288      -extern int posix_madvise();
 289      -extern int getpagesizes();
 290      -extern int getpagesizes2();
 291      -extern int mlock();
 292      -extern int mlockall();
 293      -extern int munlock();
 294      -extern int munlockall();
 295      -extern int meminfo();
 296      -extern int shm_open();
 297      -extern int shm_unlink();
 298  280  
 299      -/* transitional large file interface version */
 300      -#if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 301      -            !defined(__PRAGMA_REDEFINE_EXTNAME))
 302      -extern caddr_t mmap64();
 303      -#endif  /* _LARGEFILE64_SOURCE... */
 304      -#endif  /* __STDC__ */
 305      -
 306      -
 307  281  #endif  /* !_ASM && !_KERNEL */
 308  282  
 309  283  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 310  284  #if !defined(_ASM)
 311  285  /*
 312  286   * structure for memcntl hat advise operations.
 313  287   */
 314  288  struct memcntl_mha {
 315  289          uint_t          mha_cmd;        /* command(s) */
 316  290          uint_t          mha_flags;
↓ open down ↓ 64 lines elided ↑ open up ↑
 381  355  /* flags to mlockall */
 382  356  #define MCL_CURRENT     0x1             /* lock current mappings */
 383  357  #define MCL_FUTURE      0x2             /* lock future mappings */
 384  358  #endif /* (!defined(_XPG4_2) || (_POSIX_C_SOURCE)) || defined(__EXTENSIONS__) */
 385  359  
 386  360  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 387  361  
 388  362  /* definitions for meminfosys syscall */
 389  363  #define MISYS_MEMINFO           0x0
 390  364  
 391      -#if !defined(_ASM) && defined(__STDC__)
      365 +#if !defined(_ASM)
 392  366  
 393  367  #if defined(_INT64_TYPE)
 394  368  /* private structure for meminfo */
 395  369  typedef struct meminfo {
 396  370          const uint64_t *mi_inaddr;      /* array of input addresses */
 397  371          const uint_t *mi_info_req;      /* array of types of info requested */
 398  372          uint64_t *mi_outdata;           /* array of results are placed */
 399  373          uint_t *mi_validity;            /* array of bitwise result codes */
 400  374          int mi_info_count;              /* number of pieces of info requested */
 401  375  } meminfo_t;
↓ open down ↓ 2 lines elided ↑ open up ↑
 404  378  #if defined(_SYSCALL32)
 405  379  typedef struct meminfo32 {
 406  380          caddr32_t mi_inaddr;    /* array of input addresses */
 407  381          caddr32_t mi_info_req;  /* array of types of information requested */
 408  382          caddr32_t mi_outdata;   /* array of results are placed */
 409  383          caddr32_t mi_validity;  /* array of bitwise result codes */
 410  384          int32_t mi_info_count;  /* number of pieces of information requested */
 411  385  } meminfo32_t;
 412  386  #endif /* defined(_SYSCALL32) */
 413  387  
 414      -#endif /* !defined(_ASM) && defined(__STDC__) */
      388 +#endif /* !defined(_ASM) */
 415  389  
 416  390  /*
 417  391   * info_req request type definitions for meminfo
 418  392   * request types starting with MEMINFO_V are used for Virtual addresses
 419  393   * and should not be mixed with MEMINFO_PLGRP which is targeted for Physical
 420  394   * addresses
 421  395   */
 422  396  #define MEMINFO_SHIFT           16
 423  397  #define MEMINFO_MASK            (0xFF << MEMINFO_SHIFT)
 424  398  #define MEMINFO_VPHYSICAL       (0x01 << MEMINFO_SHIFT) /* get physical addr */
↓ open down ↓ 20 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX