28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * CDDL HEADER START
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * The contents of this file are subject to the terms
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * of the Common Development and Distribution License
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * (the "License"). You may not use this file except
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * in compliance with the License.
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * You can obtain a copy of the license at
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * See the License for the specific language governing
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * permissions and limitations under the License.
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * When distributing Covered Code, include this CDDL
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * HEADER in each file and include the License file at
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * usr/src/OPENSOLARIS.LICENSE. If applicable,
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * add the following below this CDDL HEADER, with the
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * fields enclosed by brackets "[]" replaced with your
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * own identifying information: Portions Copyright [yyyy]
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * [name of copyright owner]
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * CDDL HEADER END
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * Use is subject to license terms.
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley * test file locking
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley (void) sprintf(fname, "/tmp/oneflock.%ld", getpid());
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley file = open(fname, O_CREAT | O_TRUNC | O_RDWR, 0600);
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley for (i = 0; i < lm_optB; i ++) {