18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni/*
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * CDDL HEADER START
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni *
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * The contents of this file are subject to the terms of the
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * Common Development and Distribution License (the "License").
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * You may not use this file except in compliance with the License.
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni *
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * or http://www.opensolaris.org/os/licensing.
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * See the License for the specific language governing permissions
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * and limitations under the License.
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni *
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * When distributing Covered Code, include this CDDL HEADER in each
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * If applicable, add the following below this CDDL HEADER, with the
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * fields enclosed by brackets "[]" replaced with your own identifying
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * information: Portions Copyright [yyyy] [name of copyright owner]
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni *
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * CDDL HEADER END
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni */
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni/*
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni * Use is subject to license terms.
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni */
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni#include "chkpath.h"
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni#include <sys/syscall.h>
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni#include <sys/fcntl.h>
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoniint
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantonichown(char *s, int u, int g)
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni{
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni CHKNULL(s);
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni return (_syscall(SYS_fchownat, AT_FDCWD, s, u, g, AT_SYMLINK_NOFOLLOW));
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni}
18684922aa2666188a45f8800e7c2b57434100c7Diego Colantoni