Home | History | Annotate | Download | only in sysvipc
      1 /*
      2 * Copyright (c) International Business Machines Corp., 2007
      3 * This program is free software; you can redistribute it and/or modify
      4 * it under the terms of the GNU General Public License as published by
      5 * the Free Software Foundation; either version 2 of the License, or
      6 * (at your option) any later version.
      7 *
      8 * This program is distributed in the hope that it will be useful,
      9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
     11 * the GNU General Public License for more details.
     12 * You should have received a copy of the GNU General Public License
     13 * along with this program; if not, write to the Free Software
     14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     15 *
     16 * Author: Rishikesh K Rajak <risrajak (at) in.ibm.com>
     17 ***************************************************************************/
     18 #include <sched.h>
     19 #include "../libclone/libclone.h"
     20 #include "test.h"
     21 #include "safe_macros.h"
     22 
     23 static int dummy_child(void *v)
     24 {
     25 	(void) v;
     26 	return 0;
     27 }
     28 
     29 static void check_newipc(void)
     30 {
     31 	int pid, status;
     32 
     33 	if (tst_kvercmp(2, 6, 19) < 0)
     34 		tst_brkm(TCONF, NULL, "CLONE_NEWIPC not supported");
     35 
     36 	pid = do_clone_unshare_test(T_CLONE, CLONE_NEWIPC, dummy_child, NULL);
     37 	if (pid == -1)
     38 		tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWIPC not supported");
     39 
     40 	SAFE_WAIT(NULL, &status);
     41 }
     42