X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687964689; x=1690556689; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=dFrWhafhHam9XFB/L8D3VZgN+RgLYcztLyHOWcT19qU=; b=Y5VFFTXitQvYUnST51ki7f5hZvUgH8RdgHbdDfi6e8xJZg4OS/GaQmYsF2CSJB4fhT hezyxkPzozPUgQQ1+GZKbvbv01jleXwDNkkE8SprhuV17vjlxZdXDiybDC9eLZseEPnT +GbcXg8zXM5P1r4ZVoDiBsg7uEwqJH4V1BN72DqoGmHOzt1etzXTnb8prvWn2S+/vnJI IzfSi2Uc8kDqhsAfXZoAkORzLYVR3Bo2EFKV6Dwp5NMABgpBdo5ZMfRSSrKJFDoMGxZm 0mkyoRtvxTlHpB9i76eQBaIMYCQUpNeocmPxKc0072KRqnwV+HFEnzJGeBvjwoNvHqgA tPQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687964689; x=1690556689; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dFrWhafhHam9XFB/L8D3VZgN+RgLYcztLyHOWcT19qU=; b=hL8Ggquk18y6QHQS4bTFppbgCI+WDCdgk57w2F9uY24siy9CgDpLJoM3pDh1eSdKhJ 9kaEMv1tMvw/2ZNti7ZZlRyej6kcVXRw2IXSL4/M//Zlk/99RZKntQZZsOvEeuXRXEFy 41Zp3u3yvJWRolekeCHC1NR7Q+ZkLusLKcn+1zG8YFBecwixU/NtJ1zXqMSV3WP3GSmN YLZV3sWullVhBWP9VciTMjdDWR6VTq7lP/SgSIVIK4Yt11LsFuczG/AZ4T0ctST+sKB3 0Dpm0As5V5s+qNb8B3I3iJxF8jk2lHWsOND39hNMXODmukDmNLsLremO1xYwskPoSoel pa/g== X-Gm-Message-State: AC+VfDzK+RJyLav+Wzs/7MsBstKlJSwvBIAGxulEO/pxGIMlDQNCE7Aw eKERYEYe6JganzACjDo2guyY9O1hF6k= X-Google-Smtp-Source: ACHHUZ7Llki6/IcCI7tj9v4j3Cbm4otwnFOl0hE7cjpCDtihcU1m5wU82/jCcIshgA+RhivLUiq+Kg== X-Received: by 2002:aa7:d848:0:b0:51b:eb5f:baf with SMTP id f8-20020aa7d848000000b0051beb5f0bafmr13768088eds.18.1687964688809; Wed, 28 Jun 2023 08:04:48 -0700 (PDT) Message-ID: <7cb7c635-4f9f-6904-6171-264266ef4fb6@gmail.com> Date: Wed, 28 Jun 2023 17:04:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: djgpp AT delorie DOT com Cc: gvanem AT yahoo DOT no From: "J.W. Jagersma (jwjagersma AT gmail DOT com) [via djgpp AT delorie DOT com]" Subject: fcntl() fails to pass option flags to fs-ext handler Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Hi all, I was trying to make a non-blocking socket in Watt32 via: fcntl(sock, F_SETFL, O_NONBLOCK); To my surprise, it did nothing. Replacing fcntl() with fcntlsocket() does set the flag correctly, but that's not a portable solution. Looking at the libc code, I see the fsext handler is invoked via: int fcntl(int fd, int cmd, ...) { /* ... */ func = __FSEXT_get_function(fd); if (func) { int rv; if (__FSEXT_func_wrapper(func, __FSEXT_fcntl, &rv, fd, cmd)) return rv; } /* ... */ } From what I can tell, the flags (in va_list) are never passed through to the fsext handler. Has this ever worked? It seems like a bug to me.