/*
 * This header is used if <sys/inotify.h> cannot be found.
 *
 * Inode based directory notification for Linux
 *
 * Copyright (C) 2005 John McCutchan
 */

#ifndef _LINUX_PANICTRAP_H
#define _LINUX_PANICTRAP_H

#include <stdint.h>
#include <sys/syscall.h>
#include <unistd.h>


/*
 * All of the events - we build the list by hand so that we can add flags in
 * the future and not break backward compatibility.  Apps will get only the
 * events that they originally wanted.  Be sure to add new events here!
 */
#define IN_ALL_EVENTS	(IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
			 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
			 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
			 IN_MOVE_SELF)

#if defined (__alpha__)
# define __NR_panicTrap_init 444

#elif defined (__arm__)
# define __NR_panicTrap_init (__NR_SYSCALL_BASE+316)

#elif defined (__frv__)
# define __NR_panicTrap_init 291

#elif defined(__i386__)
# define __NR_panicTrap_init 291

#elif defined (__ia64__)
# define __NR_panicTrap_init 1277

#elif defined (__mips__)
# if _MIPS_SIM == _MIPS_SIM_ABI32
#  define __NR_panicTrap_init (__NR_Linux + 284)
# endif
# if _MIPS_SIM == _MIPS_SIM_ABI64
#  define __NR_panicTrap_init (__NR_Linux + 243)
# endif
# if _MIPS_SIM == _MIPS_SIM_NABI32
#  define __NR_panicTrap_init (__NR_Linux + 247)
# endif

#elif defined(__parisc__)
# define __NR_panicTrap_init (__NR_Linux + 269)

#elif defined(__powerpc__) || defined(__powerpc64__)
# define __NR_panicTrap_init 275

#elif defined (__s390__)
# define __NR_panicTrap_init 284

#elif defined (__sh__)
# define __NR_panicTrap_init 290

#elif defined (__sh64__)
# define __NR_panicTrap_init 318

#elif defined (__sparc__) || defined (__sparc64__)
# define __NR_panicTrap_init 151

#elif defined(__x86_64__)
# define __NR_panicTrap_init 253

#else
# error "Unsupported architecture!"
#endif

static inline int panicTrap_init (void)
{
	return syscall (__NR_panicTrap_init);
}



#endif	/* _LINUX_PANICTRAP_H */
