From owner-svn-src-stable@FreeBSD.ORG Wed Sep 3 09:05:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7924E90; Wed, 3 Sep 2014 09:05:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2E0A1764; Wed, 3 Sep 2014 09:05:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8395H0t008819; Wed, 3 Sep 2014 09:05:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8395H7r008817; Wed, 3 Sep 2014 09:05:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409030905.s8395H7r008817@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Sep 2014 09:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271010 - stable/10/sys/compat/freebsd32 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 09:05:18 -0000 Author: kib Date: Wed Sep 3 09:05:16 2014 New Revision: 271010 URL: http://svnweb.freebsd.org/changeset/base/271010 Log: MFC r270691: Fix handling of the third argument for fcntl(2). The native syscall uses long for arg, which needs translation. Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/compat/freebsd32/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 3 08:45:58 2014 (r271009) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Wed Sep 3 09:05:16 2014 (r271010) @@ -3072,3 +3072,28 @@ freebsd32_procctl(struct thread *td, str return (kern_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id), uap->com, data)); } + +int +freebsd32_fcntl(struct thread *td, struct freebsd32_fcntl_args *uap) +{ + intptr_t tmp; + + switch (uap->cmd) { + /* + * Do unsigned conversion for arg when operation + * interprets it as flags or pointer. + */ + case F_SETLK_REMOTE: + case F_SETLKW: + case F_SETLK: + case F_GETLK: + case F_SETFD: + case F_SETFL: + tmp = (unsigned int)(uap->arg); + break; + default: + tmp = uap->arg; + break; + } + return (kern_fcntl(td, uap->fd, uap->cmd, tmp)); +} Modified: stable/10/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/10/sys/compat/freebsd32/syscalls.master Wed Sep 3 08:45:58 2014 (r271009) +++ stable/10/sys/compat/freebsd32/syscalls.master Wed Sep 3 09:05:16 2014 (r271010) @@ -200,7 +200,8 @@ 89 AUE_GETDTABLESIZE NOPROTO { int getdtablesize(void); } 90 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } 91 AUE_NULL UNIMPL getdopt -92 AUE_FCNTL NOPROTO { int fcntl(int fd, int cmd, long arg); } +92 AUE_FCNTL STD { int freebsd32_fcntl(int fd, int cmd, \ + int arg); } 93 AUE_SELECT STD { int freebsd32_select(int nd, fd_set *in, \ fd_set *ou, fd_set *ex, \ struct timeval32 *tv); }