#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <sys/syscall.h>   /* For SYS_xxx definitions */

/* Testing behavior of invalid syscall.  According to
   http://www.gnu.org/software/libc/manual/html_node/System-Calls.html
   The code should just return from the kernel with -1
*/

int main()
{
	int rc;

	rc = syscall ((unsigned long)0xdeadbeef,
		      (unsigned long)0xdeadbeef);
	printf ("rc = %d (should be -1)\n", rc);
	printf ("errno = %s(%d) (should be %s(%d))\n",
		strerror(errno), errno, strerror(ENOSYS), ENOSYS);

	return (rc != -1 || errno != ENOSYS);
}
