The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: lehmann@ans-netz.de (Oliver Lehmann)
Subject: [TUHS] link() syscall implementation
Date: Sun, 15 Nov 2015 15:43:49 +0100	[thread overview]
Message-ID: <20151115154349.Horde.6dHXDRnHFazVunVIgPsob3u@avocado.salatschuessel.net> (raw)
In-Reply-To: <m2y4e0p4d7.fsf@fastmail.com>


Random832 <random832 at fastmail.com> wrote:

> Oliver Lehmann <lehmann at ans-netz.de> writes:
>> OK - it is not temporarily copied to rr4, but directly modfied in
>> rr2 and then assigned to u.u_dirp. It should be "the same" - But
>> - ln(1) does not work with this code. Instead of creating a
>> hardlink, it creates a new empty file (different inode).
>
> Are you sure this is where the problem is?

Not any longer - I tried it again with

u.u_dirp.l = (caddr_t)(((long)uap->linkname) & 0x7F00FFFF);

and it seems to work now - no idea what went wrong the last time
I tried it.

#1 rm /z/tmp/*
#2 echo "test" > /z/tmp/hugo
#3 ln /z/tmp/hugo /z/tmp/walter
ls#4  -li /z/tmp
total 2
  2452 -rw-rw-rw- 2 wega     system        5 Nov 15 02:44 hugo
  2452 -rw-rw-rw- 2 wega     system        5 Nov 15 02:44 walter
#5

I still have direct modification of rr2 and not the copy to rr4,
so if I would aim for binary equalness it is still not the same,
but it seems that it can't be done another way.



  reply	other threads:[~2015-11-15 14:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14 12:34 Oliver Lehmann
2015-11-14 12:56 ` Oliver Lehmann
2015-11-14 15:17   ` Oliver Lehmann
2015-11-14 21:18     ` Random832
2015-11-14 21:42       ` Oliver Lehmann
2015-11-14 23:07         ` Random832
2015-11-15 14:43           ` Oliver Lehmann [this message]
2015-11-14 13:33 ` Random832

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=20151115154349.Horde.6dHXDRnHFazVunVIgPsob3u@avocado.salatschuessel.net \
    --to=lehmann@ans-netz.de \
    /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).