📄 tshutdwn.c
字号:
/* $Header: /usr/cvsroot/target/src/wrn/wm/demo/socktest/tshutdwn.c,v 1.1.1.1 2001/11/05 17:49:15 tneale Exp $ *//* * Copyright (C) 1999-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//**************************************************************************** * Copyright 1998 Integrated Systems, Inc. * All rights reserved. ****************************************************************************//* * $Log: tshutdwn.c,v $ * Revision 1.1.1.1 2001/11/05 17:49:15 tneale * Tornado shuffle * * Revision 1.2 2001/01/19 22:24:56 paul * Update copyright. * * Revision 1.1 2000/10/16 19:23:15 paul * Renamed from test_shutdown.c * * Revision 1.4 2000/03/17 00:14:49 meister * Update copyright message * * Revision 1.3 1999/07/30 21:29:49 paul * enhanced test_fail, test_pass * * Revision 1.2 1999/02/18 04:16:17 wes * Socket Merge: new code (socket tests). * * Revision 1.1.2.2 1998/11/06 23:36:55 paul * rototill to support tcp * *//* [clearcase]modification history-------------------01a,19apr05,job update copyright notices*/#include "test.h"voidtest_shutdown(int flags){ int s; s = socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) { test_fail(0, "shutdown", "socket"); return; } test(0, "shutdown(0)", shutdown(s, 0), 0, 0); test(0, "shutdown(1)", shutdown(s, 1), 0, 0); test(0, "shutdown(2)", shutdown(s, 2), 0, 0); test(0, "shutdown(3)", shutdown(s, 3), -1, EINVAL); close(s); test(0, "shutdown closed socket", shutdown(s, 2), -1, EBADF);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -