|
From: | Matt Wette |
Subject: | Re: patch for mmap and friends |
Date: | Sat, 14 Jan 2023 14:08:17 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 1/14/23 7:18 AM, Maxime Devos wrote:
\
Port objects should be accepted too, as previously asked on <https://lists.gnu.org/archive/html/guile-user/2022-06/msg00060.html>.
As implied by later comments, using a raw fd causes problems with 'move->fdes'. For the remaining response, I'll assume that the function accepts ports as well.
To avoid this problem, you can add
scm_remember_upto_here_1 (fd);
after the SCM_SYSCALL.
\
IIRC there is a C trick involving fields, arrays and types to check this at compile-time instead. Maybe:
struct whatever {
/* if availability of zero-length arrays can be assumed */
int foo[sizeof(size_t) - sizeof(void*)];
/* alternatively, a weaker but portable check */
int foo[sizeof(size_t) - sizeof(void*) + 1];
};
Greetings,
Maxime.
Thanks for the feedback. I'm sorry I missed you comments on the previous round.
I did respond to the ones I did catch. I'll work this and resubmit.
Matt
[Prev in Thread] | Current Thread | [Next in Thread] |