⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 16-1.c

📁 最新rtlinux内核源码
💻 C
字号:
/*    * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by:  julie.n.fleischer REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license.  For the full content * of this license, see the COPYING file at the top level of this  * source tree. * Test that timer_create() sets errno to EINVAL if clock_id is not * a defined clock ID. */#include <time.h>#include <signal.h>#include "compat.h"#include <errno.h>#define PASS 0#define FAIL 1#define UNRESOLVED 2#define INVALIDCLOCKID 99999int init_module(void){	struct sigevent ev;	timer_t tid;	ev.sigev_notify = SIGEV_SIGNAL;	ev.sigev_signo = SIGALRM;	if (timer_create(INVALIDCLOCKID, &ev, &tid) == -1) {		if (EINVAL == errno) {			printf("Test PASSED\n");			return PASS;		} else {			printf("errno != EINVAL\n");			printf("Test FAILED\n");			return FAIL;		}	} else {		printf("timer_create returned success\n");		return UNRESOLVED;	}	return UNRESOLVED;}void cleanup_module(void){}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -