thr_system.c revision 63364
116909Salanb/* 216909Salanb * Copyright (C) 2000 Jason Evans <jasone@freebsd.org>. 316909Salanb * All rights reserved. 416909Salanb * 516909Salanb * Redistribution and use in source and binary forms, with or without 616909Salanb * modification, are permitted provided that the following conditions 716909Salanb * are met: 816909Salanb * 1. Redistributions of source code must retain the above copyright 916909Salanb * notice(s), this list of conditions and the following disclaimer as 1016909Salanb * the first lines of this file unmodified other than the possible 1116909Salanb * addition of one or more copyright notices. 1216909Salanb * 2. Redistributions in binary form must reproduce the above copyright 1316909Salanb * notice(s), this list of conditions and the following disclaimer in 1416909Salanb * the documentation and/or other materials provided with the 1516909Salanb * distribution. 1616909Salanb * 1716909Salanb * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 1816909Salanb * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1916909Salanb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2016909Salanb * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE 2116909Salanb * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2216909Salanb * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2316909Salanb * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 2416909Salanb * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 2516909Salanb * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 2616909Salanb * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 2716909Salanb * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2816909Salanb * 2917089Salanb * $FreeBSD: head/lib/libkse/thread/thr_system.c 63364 2000-07-18 01:38:19Z jasone $ 3016909Salanb */ 3116909Salanb 3216909Salanb#include <stdlib.h> 3316909Salanb#ifdef _THREAD_SAFE 3416909Salanb#include <pthread.h> 3516909Salanb#include "pthread_private.h" 3616909Salanb 3716909Salanbint 3816909Salanbsystem(const char *string) 3916909Salanb{ 4016909Salanb int ret; 4116909Salanb 4216909Salanb _thread_enter_cancellation_point(); 4316909Salanb ret = __system(string); 4416909Salanb _thread_leave_cancellation_point(); 4516909Salanb 4616909Salanb return ret; 4716909Salanb} 4816909Salanb#endif 4916909Salanb