From patchwork Thu Sep 7 21:06:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 811169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-84316-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Dzi8Gcdv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xpCgL3wLwz9t16 for ; Fri, 8 Sep 2017 07:06:38 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=JqP8sgc+MSMwo7IaMBIxzKlLSlymy zQiQQjeyiyHhBiAOumYwQ2749zw0F3vECmsoyFgKF1g/2yxaz4g2X2fgZeTLjHCr 36mDY6iSrNn2R8MgUIiRVUWa7BKSU6jFLHdbpM/l3aRy7uyqdp0PEHXPV/ZIBHkW 7+ldNO7CTX1EDM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=AbRl9IycQOVoty8kkjnUChvQ6tI=; b=Dzi 8GcdvcMSDHCSwD4RBShox9EfhcL64CRWmFig4TZFDu2fOnMB8pXBCUcvDdyQN6ka brlkldjxsFc5xL7TKbPKh3XuuttRTJ7y9hsPvUTWDdiy0ljfM3ngJbmwwEk6/MwP fVjYndW1ki4Ky9vuObIdm1IMdSoArds+pZW0LSXg= Received: (qmail 75978 invoked by alias); 7 Sep 2017 21:06:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 75967 invoked by uid 89); 7 Sep 2017 21:06:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:2206, life X-HELO: relay1.mentorg.com Date: Thu, 7 Sep 2017 21:06:18 +0000 From: Joseph Myers To: Subject: Add Linux 4.13 constants to bits/fcntl-linux.h Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) This patch, relative to a tree with (pending review) applied (but with only trivial dependence on that patch by virtue of changing adjacent code), adds new interfaces (F_GET_RW_HINT etc., and associated RW[FH]_WRITE_LIFE_*) from Linux 4.13 to bits/fcntl-linux.h (conditional on __USE_GNU). Tested for x86_64. 2017-09-07 Joseph Myers * sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU] (F_GET_RW_HINT): New macro. [__USE_GNU] (F_SET_RW_HINT): Likewise. [__USE_GNU] (F_GET_FILE_RW_HINT): Likewise. [__USE_GNU] (F_SET_FILE_RW_HINT): Likewise. [__USE_GNU] (RWF_WRITE_LIFE_NOT_SET): Likewise. [__USE_GNU] (RWH_WRITE_LIFE_NONE): Likewise. [__USE_GNU] (RWH_WRITE_LIFE_SHORT): Likewise. [__USE_GNU] (RWH_WRITE_LIFE_MEDIUM): Likewise. [__USE_GNU] (RWH_WRITE_LIFE_LONG): Likewise. [__USE_GNU] (RWH_WRITE_LIFE_EXTREME): Likewise. diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h index fc65fc2..0c1a303 100644 --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h @@ -204,6 +204,11 @@ # define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ # define F_ADD_SEALS 1033 /* Add seals to file. */ # define F_GET_SEALS 1034 /* Get seals for file. */ +/* Set / get write life time hints. */ +# define F_GET_RW_HINT 1035 +# define F_SET_RW_HINT 1036 +# define F_GET_FILE_RW_HINT 1037 +# define F_SET_FILE_RW_HINT 1038 #endif #ifdef __USE_XOPEN2K8 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with @@ -281,6 +286,16 @@ struct f_owner_ex # define F_SEAL_WRITE 0x0008 /* Prevent writes. */ #endif +#ifdef __USE_GNU +/* Hint values for F_{GET,SET}_RW_HINT. */ +# define RWF_WRITE_LIFE_NOT_SET 0 +# define RWH_WRITE_LIFE_NONE 1 +# define RWH_WRITE_LIFE_SHORT 2 +# define RWH_WRITE_LIFE_MEDIUM 3 +# define RWH_WRITE_LIFE_LONG 4 +# define RWH_WRITE_LIFE_EXTREME 5 +#endif + /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_MISC