From owner-freebsd-hackers@freebsd.org Wed Jul 8 17:22:13 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFCEB368733 for ; Wed, 8 Jul 2020 17:22:13 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B25hh6vxXz4L4K for ; Wed, 8 Jul 2020 17:22:12 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id f18so41757453wrs.0 for ; Wed, 08 Jul 2020 10:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IFi6p0Avv0e2wkdvfCkvvc8tEl4M42RYP7uKkpvKs6k=; b=hKteJILnv3R4S+GfpVbo+ibADuVfowzQXJh5FVGakeIgJldenrn8xlgswsuqGUwBze LXSxcdvcbeqscoL2UNNbW+ClG9Vs5w8vUr0+GQNDLsVhd0PiTHSpGAaBPa4V+FqC8EaY GKQ96fIlMHOb457cBfWiP2xMJjCc4eFXAUwRS98IQY7z5E/LMhcP7sLurvHZJUz+mzI6 0+WGCTP/loZknp6NtAxJVECOATD2Ra6sdd/1V4jT12RaTyoLrT3HduhzbozT522SWjt6 D0vxZKId1g+FM1pQAt0iyX/1k2/5/If4zzWOIiZ0eVhyPFPDecBREs7e0U/iceJMep9r BGJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IFi6p0Avv0e2wkdvfCkvvc8tEl4M42RYP7uKkpvKs6k=; b=Tz774ZwFfOzfYj+LYcz3QE0EAv9erzkOQNnWG6wLQLzLfR9rCqsjXZby70sFiSq1vk 8FBrjdCJcEMpJ1JK27+/Qz/7rJ+KnRvH+4HwPLGuI1Kmq6h4i9KOmsYcj4BtRe6ktS8h Z+rp5yaH9Xf7+c6JLTxdK5UUqDM1j64GOZmtXNyVqK63zJUy+OUIgTtM6GkhDffLYiwr TKWLKCa3B3jw5ykboTTDYQUaCmAutCWSz6+ytvvceWGgxpQU9cp2mdaH/2CVBbrCYEHn hBojvCShtD3Qt40nmg7/VYhfrD2oPuOX06BEPwBxMCsRwYDijOAKBTrSgCx2sKuaLFDh 2tMA== X-Gm-Message-State: AOAM532r2EfaH2LndHdP24fJbuJZJwcl75syOBNqczdPmIiEtwtRtihf h8DD+2BkPEM/JOGxIOS7PKapgnmDBGwdPKwacqF9sg== X-Google-Smtp-Source: ABdhPJwYQ6o/QsyQPlfpwzPE6DknV5OiwfNsqg+CtZPZXAWsFglPu7yMBSzxfOtZnPqslem7AK4GdxBdsLH2bPd/cxc= X-Received: by 2002:a05:6000:1290:: with SMTP id f16mr33037905wrx.66.1594228931493; Wed, 08 Jul 2020 10:22:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Wed, 8 Jul 2020 10:22:10 -0700 (PDT) In-Reply-To: <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> From: Mateusz Guzik Date: Wed, 8 Jul 2020 19:22:10 +0200 Message-ID: Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B25hh6vxXz4L4K X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=hKteJILn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::429 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.16 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.05)[-1.054]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::429:from]; NEURAL_HAM_SHORT(-0.12)[-0.120]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 17:22:13 -0000 llvm is an example reason why I'm reluctant to add this. llvm currently will perform realpath, which was converted to a syscall and with other upcoming changed will be quite cheap, but most importantly reliable. F_GETPATH can easily fail which makes me really wary of this without always adding names to the namecache. On 7/8/20, Yuri wrote: > On 2020-07-08 09:59, Mateusz Guzik wrote: >> I can't be arsed to find all the proper headers, but you get the idea. >> If this makes the program work well enough I can commit and merge to >> stable/12. > > > This particular project (watchman) looks for F_GETPATH and fails because > it isn't defined. If you would add it to 12.1 this would be great. > > llvm sources also contain references to F_GETPATH. > > > Thank you, > > Yuri > > > -- Mateusz Guzik