bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Jay K <jayk123@hotmail.com>
To: "bug-gnulib@gnu.org" <bug-gnulib@gnu.org>
Cc: Larkin Nickle <me@larbob.org>
Subject: getprocname Tru64
Date: Tue, 29 Jun 2021 08:24:53 +0000	[thread overview]
Message-ID: <MWHPR1401MB1951D63EFD26D7743712729EE6029@MWHPR1401MB1951.namprd14.prod.outlook.com> (raw)
In-Reply-To: <MWHPR1401MB19511AE92ADF4922E583AA4AE6029@MWHPR1401MB1951.namprd14.prod.outlook.com>

I see I lost the race here, but here is my rendition of getprogname for Tru64, much more efficient.

> diff -c getprogname.c.orig getprogname.c
*** getprogname.c.orig  Tue Jun 29 03:46:44 2021
--- getprogname.c       Tue Jun 29 03:48:55 2021
***************
*** 283,288 ****
--- 283,291 ----
        close (fd);
      }
    return "?";
+ # elif defined __osf__
+   extern char** __Argv;
+   return last_component (__Argv[0]);
  # else

I came to this by:
1: Looked in old gcc to find:
#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"

2: grep/nm/dis there.

I had hoped to step through the startup but haven't learned this dbx yet.

There is also maybe "auxv" stuff.

I find the proc file system kinda gross and inefficient but yeah.

Thank you,
 - Jay




  reply	other threads:[~2021-06-29 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  8:17 Makefile operator -ot generate-parse-datetime tru64 Jay K
2021-06-29  8:24 ` Jay K [this message]
2021-06-29 15:04   ` getprocname Tru64 Bruno Haible
2021-07-06 11:25     ` Jay K
2021-06-29 14:52 ` Makefile operator -ot generate-parse-datetime tru64 Bruno Haible
2021-07-01 17:41 ` Paul Eggert

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=MWHPR1401MB1951D63EFD26D7743712729EE6029@MWHPR1401MB1951.namprd14.prod.outlook.com \
    --to=jayk123@hotmail.com \
    --cc=bug-gnulib@gnu.org \
    --cc=me@larbob.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 read-only IMAP folder(s) and NNTP newsgroup(s).