9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
To: cinap_lenrek@felloff.net
Cc: 9front@9front.org
Subject: Re: [9front] ape/_errno: ENOENT
Date: Thu, 06 Jan 2022 14:35:45 +0100	[thread overview]
Message-ID: <874k6hc7gu.fsf@turtle-trading.net> (raw)
In-Reply-To: <A6B41B7C00BD9BC6593C9AA82A88338C@felloff.net> (cinap lenrek's message of "Wed, 05 Jan 2022 20:13:55 +0100")

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

Hi cinap,

cinap writes:
> how's that solving anything? i can't seem to find a "No such file ..."
> error to be generated from the kernel or cwfs and hjfs?

I could not find it either.  I recreated the problem and it seems APE's
stat generates that error somehow.  See the attached test program
(compile with pcc).  Maybe the message is somewhere in APE, although I
could not find it in /sys/src/ape either.  If it is in APE, the errno or
the errmsg could be fixed there, of course.

Thanks, benny


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

#define _POSIX_SOURCE
#define _PLAN9_SOURCE

#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#include "/sys/src/ape/lib/ap/plan9/sys9.h"

int
main (void)
{
        struct stat attrs;
        stat("no-such-file", &attrs);
        int ecode = errno;
        char err[100];
        _ERRSTR(err, sizeof err);
        printf("errstr: %s\n", err);
        switch(ecode) {
        case ENOENT:
                printf("errno: ENOENT\n");
                break;
        case EPLAN9:
                printf("errno: EPLAN9\n");
                break;
        default:
                printf("errno: %d\n", ecode);
                break;
        }

        return 0;
}


  reply	other threads:[~2022-01-06 14:20 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 [this message]
2022-01-06 16:27     ` ori
2022-01-06 17:32       ` Benjamin Riefenstahl
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=874k6hc7gu.fsf@turtle-trading.net \
    --to=b.riefenstahl@turtle-trading.net \
    --cc=9front@9front.org \
    --cc=cinap_lenrek@felloff.net \
    /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).