github.com/apptainer/singularity@v3.1.1+incompatible/cmd/starter/c/include/setns.h (about)

     1  /*
     2   * Copyright (c) 2017-2019, SyLabs, Inc. All rights reserved.
     3   * Copyright (c) 2017, SingularityWare, LLC. All rights reserved.
     4   * 
     5   * See the COPYRIGHT.md file at the top-level directory of this distribution and at
     6   * https://github.com/sylabs/singularity/blob/master/COPYRIGHT.md.
     7   * 
     8   * This file is part of the Singularity Linux container project. It is subject to the license
     9   * terms in the LICENSE.md file found in the top-level directory of this distribution and
    10   * at https://github.com/sylabs/singularity/blob/master/LICENSE.md. No part
    11   * of Singularity, including this file, may be copied, modified, propagated, or distributed
    12   * except according to the terms contained in the LICENSE.md file.
    13   * 
    14  */
    15  
    16  
    17  #ifndef __SETNS_H_
    18  #define __SETNS_H_
    19  
    20  #ifndef __NR_setns
    21  #  if defined (__x86_64__)
    22  #    define __NR_setns 308
    23  #  elif defined (__i386__)
    24  #    define __NR_setns 346
    25  #  elif defined (__alpha__)
    26  #    define __NR_setns 501
    27  #  elif defined (__arm__)
    28  #    define __NR_setns 375
    29  #  elif defined (__aarch64__)
    30  #    define __NR_setns 375
    31  #  elif defined (__ia64__)
    32  #    define __NR_setns 1330
    33  #  elif defined (__sparc__)
    34  #    define __NR_setns 337
    35  #  elif defined (__powerpc__)
    36  #    define __NR_setns 350
    37  #  elif defined (__s390__)
    38  #    define __NR_setns 339
    39  #  endif
    40  #endif
    41  
    42  #ifdef __NR_setns
    43  
    44  extern int setns(int fd, int nstype);
    45  
    46  #else /* !__NR_setns */
    47  #  error Please determine the syscall number for setns on your architecture
    48  #endif
    49  
    50  #endif /* __SETNS_H_ */