9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
To: 9front@9front.org
Subject: Re: [9front] ape/_errno: ENOENT
Date: Thu, 06 Jan 2022 18:32:58 +0100	[thread overview]
Message-ID: <87lezsahx1.fsf@turtle-trading.net> (raw)
In-Reply-To: <8489010B86CFD46EA69165F237249F0A@eigenstate.org> (ori@eigenstate.org's message of "Thu, 06 Jan 2022 11:27:00 -0500")

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

Hi ori,

> Quoth Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>:
>> Maybe the message is somewhere in APE, although I
>> could not find it in /sys/src/ape either.

ori writes:
> ./lib/ap/stdio/strerror.c:33: 	"No such file or directory",

But the actual error message is just "No such file", so some code would
have to cut the rest explicitly to get from that bit in strerror.c to
that result.

It seems that the text does actually come from the syscall, see attached
new test.  I can't find the implementation in the kernel right now,
maybe somebody has a pointer.

Thanks for any insight,
benny


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test-enoent.c --]
[-- Type: text/x-csrc, Size: 535 bytes --]

#define _POSIX_SOURCE
#define _PLAN9_SOURCE

#include <stdio.h>

#include "/sys/src/ape/lib/ap/plan9/lib.h"
#include "/sys/src/ape/lib/ap/plan9/sys9.h"
#include "/sys/src/ape/lib/ap/plan9/dir.h"

#define DIRSIZE	(STATFIXLEN + 16 * 4)

int
main (void)
{
        char err[100] = "";
        _ERRSTR(err, sizeof err);
        unsigned char buf[sizeof(Dir) + BIT16SZ + DIRSIZE];
        int n = _STAT("no-such-file-here", buf, BIT16SZ + DIRSIZE);
        _ERRSTR(err, sizeof err);
        printf("errstr: %s\n", err);
        return 0;
}


  reply	other threads:[~2022-01-06 17:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 19:50 Benjamin Riefenstahl
2022-01-05 19:13 ` cinap_lenrek
2022-01-06 13:35   ` Benjamin Riefenstahl
2022-01-06 16:27     ` ori
2022-01-06 17:32       ` Benjamin Riefenstahl [this message]
2022-01-06 20:24         ` Xiao-Yong Jin
2022-01-07 10:09           ` Benjamin Riefenstahl
2022-01-10  1:55         ` 有澤 健治

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lezsahx1.fsf@turtle-trading.net \
    --to=b.riefenstahl@turtle-trading.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).