Opened 6 days ago

Last modified 4 days ago

#71265 new enhancement

Adding pthread_[f]chdir_np to legacy-support - contribution guidelines? — at Initial Version

Reported by: RJVB (René Bertin) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: fhgwright (Fred Wright), mascguy (Christopher Nielsen)
Port: legacy-support

Description

I have come across an application (not currently in MacPorts; Firefox Dynasty for "legacy" systems) that can make an unprotected call to pthread_chdir_np or pthread_fchdir_np, two functions that were introduced in 10.12 but were available as syscalls from 10.5 onwards.

Based on old Chromium code it should be possible to provide these functions on 10.11 and earlier with a pair of simple wrappers:

int pthread_chdir_np(const char* dir)
{
  return syscall(SYS___pthread_chdir, dir);
}

int pthread_fchdir_np(int fd)
{
  return syscall(SYS___pthread_fchdir, fd);
}

I realise port:legacy-support is mainly intended for use with MacPorts and doesn't aim to provide every possible missing symbol, so I'd be perfectly happy with some guidelines or pointers how to add these 2 wrappers the proper way in a personal fork of the repo (i.e. in such a way that they only get included on 10.11 and earlier).

Reason I'm filing a trac ticket is that there is no dedicated issue tracker, and the application in question could make a valuable new port for other owners of retro systems (i.e. Firefox v132 that runs on at least 10.8 and up).

(I did try to contribute a patch "upstream" but let's just say that my efforts weren't appreciated and the maintainer not particularly interested in bug reports.)

Change History (1)

Changed 4 days ago by RJVB (René Bertin)

draft implementation

Note: See TracTickets for help on using tickets.