/*1* Copyright (c) 2007 Apple Inc. All rights reserved.2*3* @APPLE_APACHE_LICENSE_HEADER_START@4*5* Licensed under the Apache License, Version 2.0 (the "License");6* you may not use this file except in compliance with the License.7* You may obtain a copy of the License at8*9* http://www.apache.org/licenses/LICENSE-2.010*11* Unless required by applicable law or agreed to in writing, software12* distributed under the License is distributed on an "AS IS" BASIS,13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14* See the License for the specific language governing permissions and15* limitations under the License.16*17* @APPLE_APACHE_LICENSE_HEADER_END@18*/1920#include <sys/syscall.h>21#include <unistd.h>22#include <signal.h>2324#include "kill2.h"2526int27kill2(pid_t pid, int sig)28{29/*30* POSIX defines consistency over correctness, and consequently31* kill/killpg now returns EPERM instead of ESRCH.32*33* I've filed 5487498 to get a non-portable kill().34* We'll regretfully take advantage of implementation details for now.35*/36return syscall(SYS_kill, pid, sig, 0);37}3839int40killpg2(pid_t pgrp, int sig)41{42return kill2(-pgrp, sig);43}444546