Opened 4 years ago
Closed 4 years ago
#61129 closed defect (fixed)
legacy-support: needs lutimes
Reported by: | kencu (Ken) | Owned by: | kencu (Ken) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | fhgwright (Fred Wright) | |
Port: | legacy-support |
Description
This function is occasionally used, and I believe is fairly simple to implement.
Needed on Tiger only.
Change History (12)
comment:1 Changed 4 years ago by fhgwright (Fred Wright)
comment:2 Changed 4 years ago by kencu (Ken)
Oh, I think it will be much easier than "impossible", like the other 100 functions I've done.
NAME lutimes -- set file access and modification times of symlink
comment:3 Changed 4 years ago by kencu (Ken)
I see the call is implemented as an emulated function using setattrlist, and that function exists on Tiger, so probably just copy/paste it out of 10.5's libc implementation.
I already did lchmod
a few years ago, and it's probably almost identical <https://github.com/macports/macports-legacy-support/blob/master/src/lchmod.c>
comment:4 Changed 4 years ago by kencu (Ken)
comment:5 Changed 4 years ago by kencu (Ken)
This is the exact one in Leopard 10.5.8 <https://opensource.apple.com/source/Libc/Libc-498.1.7/emulated/lutimes.c.auto.html>
comment:7 Changed 4 years ago by kencu (Ken)
Would you like to implement it? I sure could use some help. The function is pretty straightforward, it seems, but we would like a test for it too, if possible, to be sure it works.
comment:8 Changed 4 years ago by fhgwright (Fred Wright)
OK, I could give it a shot. Perhaps not immediately, but it doesn't look hard. IIRC, legacy-support includes a bunch of tests for the functions it implements, so the test framework exists.
comment:10 Changed 4 years ago by kencu (Ken)
comment:12 Changed 4 years ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Although I haven't dug into it in detail, my impression is that this function is impossible to implement correctly in 10.4, since the capability is missing from the OS. That means that one would have to choose between an "honest" implementation which always fails, and a "speak no evil" implementation that does nothing and reports success. The former would be consistent with what cmake does when the function is unavailable, but I don't know about other uses.
Either approach would be trivial to implement.