github.com/rohankumardubey/syslog-redirector-golang@v0.0.0-20140320174030-4859f03d829a/src/pkg/runtime/os_plan9.h (about)

     1  // Copyright 2010 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Plan 9-specific system calls
     6  int32	runtime·pread(int32 fd, void *buf, int32 nbytes, int64 offset);
     7  int32	runtime·pwrite(int32 fd, void *buf, int32 nbytes, int64 offset);
     8  int64	runtime·seek(int32 fd, int64 offset, int32 whence);
     9  void	runtime·exits(int8* msg);
    10  intptr	runtime·brk_(void*);
    11  int32	runtime·sleep(int32 ms);
    12  int32	runtime·rfork(int32 flags, void *stk, M *mp, G *gp, void (*fn)(void));
    13  int32	runtime·plan9_semacquire(uint32 *addr, int32 block);
    14  int32	runtime·plan9_tsemacquire(uint32 *addr, int32 ms);
    15  int32 	runtime·plan9_semrelease(uint32 *addr, int32 count);
    16  int32	runtime·notify(void (*fn)(void*, int8*));
    17  int32	runtime·noted(int32);
    18  void	runtime·sigtramp(void*, int8*);
    19  void	runtime·sigpanic(void);
    20  void	runtime·goexitsall(int8*);
    21  void	runtime·setfpmasks(void);
    22  
    23  /* open */
    24  enum
    25  {
    26  	OREAD	= 0,
    27  	OWRITE	= 1,
    28  	ORDWR	= 2,
    29  	OEXEC	= 3,
    30  	OTRUNC	= 16,
    31  	OCEXEC	= 32,
    32  	ORCLOSE	= 64,
    33  	OEXCL	= 0x1000
    34  };
    35  
    36  /* rfork */
    37  enum
    38  {
    39  	RFNAMEG         = (1<<0),
    40  	RFENVG          = (1<<1),
    41  	RFFDG           = (1<<2),
    42  	RFNOTEG         = (1<<3),
    43  	RFPROC          = (1<<4),
    44  	RFMEM           = (1<<5),
    45  	RFNOWAIT        = (1<<6),
    46  	RFCNAMEG        = (1<<10),
    47  	RFCENVG         = (1<<11),
    48  	RFCFDG          = (1<<12),
    49  	RFREND          = (1<<13),
    50  	RFNOMNT         = (1<<14)
    51  };
    52  
    53  /* notify */
    54  enum
    55  {
    56  	NCONT	= 0,
    57  	NDFLT	= 1
    58  };
    59  
    60  typedef struct Tos Tos;
    61  typedef intptr Plink;
    62  
    63  struct Tos {
    64  	struct			/* Per process profiling */
    65  	{
    66  		Plink	*pp;	/* known to be 0(ptr) */
    67  		Plink	*next;	/* known to be 4(ptr) */
    68  		Plink	*last;
    69  		Plink	*first;
    70  		uint32	pid;
    71  		uint32	what;
    72  	} prof;
    73  	uint64	cyclefreq;	/* cycle clock frequency if there is one, 0 otherwise */
    74  	int64	kcycles;	/* cycles spent in kernel */
    75  	int64	pcycles;	/* cycles spent in process (kernel + user) */
    76  	uint32	pid;		/* might as well put the pid here */
    77  	uint32	clock;
    78  	/* top of stack is here */
    79  };
    80  
    81  #define	NSIG	5	/* number of signals in runtime·SigTab array */
    82  #define	ERRMAX	128	/* max length of note string */