From nobody Fri Jan 12 16:41:23 2024 X-Original-To: freebsd-threads@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TBS3l3x8Hz578H1 for ; Fri, 12 Jan 2024 16:41:39 +0000 (UTC) (envelope-from vini.ipsmaker@gmail.com) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TBS3k5DTnz4Wdb for ; Fri, 12 Jan 2024 16:41:38 +0000 (UTC) (envelope-from vini.ipsmaker@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=mvE+6Ei0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of vini.ipsmaker@gmail.com designates 2a00:1450:4864:20::235 as permitted sender) smtp.mailfrom=vini.ipsmaker@gmail.com Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2cd81b09e83so29190321fa.2 for ; Fri, 12 Jan 2024 08:41:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705077696; x=1705682496; darn=freebsd.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MIpzcdGQntw6wRooErGkIe7sjWDi1TE4kIq35LeOTbA=; b=mvE+6Ei0m5MyUaLViceRg6TuftLXnGB3OSgKOGRthXPUwibn1Q77Z9w3mva+m+o4fd X8ygyv0UgPgGodQbh73GUmuVlDt+nHgdfZTDqEZfK5A4CVluRPtBfpOyeEKWQJvEoL2v aGokZhsAE0Q5VDfQ71vwAC0hsJYdYfAEJL4/TmzXfe26yzc5cs+sE3a4QLEnrzp4JqWT 4rcJM4ZMqfGZBoQFrh+g1XIbc7STTp6CGazrio4eLYW91lA6BD9ISpRQYqGtaABbcbXo z46REK76OUdsoVSJhkw+C8qppKXfifuiyLz9X3WAsco3lUk+GgupHYUluqHf1isTInxa HwBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705077696; x=1705682496; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MIpzcdGQntw6wRooErGkIe7sjWDi1TE4kIq35LeOTbA=; b=quRRl6I3O7geOWYA1DIfBeYD6qwQxUfF/QFMjgAxnml76YNF/lcZlZF25GNf2tFY8f zeP4Mu3NIFPH0yEgu1L78kbNzH0Of2hPriaiE3pav6RxOw/o13+lY3AwFqbj6ggCUXR+ 5RUiH2zDI98aD8ioicM2oeqtvqQKATLsWHhpY4gya2+KsbR0iGjYQHReqBs868hOUxWz pr1ouYiTlKfuWdPZu2VPWAAnlCBLrqpcDnDQpKjfeWF5GJVDVcB0ogDVDI+JpCHOuGIO uzHFuAjDNKagjh1UfU6oOyGMvw7jzwKgP3A3kJ21NiSZEzNFbR7UyOI8fFUbDlgN8xM0 Oylg== X-Gm-Message-State: AOJu0YyQ2Gi04XV0mFZhE0nGnFX6BdU0P71u2vwIkbFCwbv6BD7jALg9 9UWwZxIC9O9PCxwfSABhUCTNnylZR46sX2b+emlCwvdiWlQ= X-Google-Smtp-Source: AGHT+IEk8cKn9cYRbdXh7460DYpLtpV/Tzd7pN+ZoseryW44VSJBONN7RgPkH6ALincOyWdqDsx6dVzurRtpT0wWz64= X-Received: by 2002:a05:651c:2051:b0:2cc:8bc7:570f with SMTP id t17-20020a05651c205100b002cc8bc7570fmr363583ljo.193.1705077696180; Fri, 12 Jan 2024 08:41:36 -0800 (PST) List-Id: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 From: =?UTF-8?Q?Vin=C3=ADcius_dos_Santos_Oliveira?= Date: Fri, 12 Jan 2024 13:41:23 -0300 Message-ID: Subject: aio_read2() and aio_write2() To: freebsd-threads@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.37 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-1.00)[-0.996]; R_MIXED_CHARSET(0.63)[subject]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TAGGED_FROM(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-threads@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-threads@freebsd.org]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::235:from] X-Rspamd-Queue-Id: 4TBS3k5DTnz4Wdb Can we have some aio_read() function that ignores aio_offset (i.e. the current file position is used)? I'm trying to port libboost's ASIO file support to FreeBSD, and I stumbled upon this limitation. Boost.Asio only exposes file support for proactor systems (Windows IOCP and Linux io_uring). For Windows and Linux, it's possible to perform the feature I'm requesting (on Linux you just pass -1 as the offset to ignore it in io_uring). Boost.Asio offers two interfaces for file IO on proactor systems: serial access (current file offset is used) and random access (you always specify an offset). Right now it's only possible to implement the random access interface for FreeBSD. What I'd like to see: int aio_read2(struct aiocb *iocb, unsigned flags); int aio_write2(struct aiocb *iocb, unsigned flags); aio_read(iocb) would be equivalent to aio_read2(iocb, 0) and aio_write(iocb) would be equivalent to aio_write2(iocb, 0). Then we would define the following flags: AIO_USEIOV AIO_IGNOREOFFSET aio_readv(iocb) would be equivalent to aio_read2(iocb, AIO_USEIOV) and aio_writev(iocb) would be equivalent to aio_write2(iocb, AIO_USEIOV). The flag AIO_IGNOREOFFSET would instruct the call to ignore aio_offset in aiocb and use the file position (lseek) if applicable. This flag should not conflict with LIO opcodes so one could OR it into aio_lio_opcode for usage with lio_listio() as well. --=20 Vin=C3=ADcius dos Santos Oliveira https://vinipsmaker.github.io/