mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Sfio may theoretically be compiled with threads support using a separate AT&T library called Vthread, also by Kiem-Phong Vo. That library was never shipped in the AST distribution, though. It is only available with a standalone version of Sfio. The only standalone Sfio version with Vthread that I've found is from 2005, mirrored at <https://github.com/lichray/sfio>. More recent versions never seem to have made it out of the defunct AT&T software download site. Even if they weren't, the rest of libast doesn't support threads, and at this point it never will, so for our purposes the Sfio threads code is never going to be usable. Meanwhile, macros such as SFMTXENTER and SFMTXRETURN make the code a lot harder to read. And not quite all threading code is disabled; some of it is dead code that is getting compiled in. Chances are that code now won't work properly in any case as we've not had any chance to test it as we were making changes. Bit rot has surely set in by now. So this commit expands all the sfio/stdio threading-related macros to their non-threads fallbacks (which is null for most of them, but not all), deletes dead mutex-related code and struct fields, and removes the related documentation from the sfio.3 man page. Unless I did something wrong, there should be no change in behaviour.
34 lines
1.8 KiB
C
34 lines
1.8 KiB
C
/***********************************************************************
|
|
* *
|
|
* This software is part of the ast package *
|
|
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
|
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
|
* and is licensed under the *
|
|
* Eclipse Public License, Version 1.0 *
|
|
* by AT&T Intellectual Property *
|
|
* *
|
|
* A copy of the License is available at *
|
|
* http://www.eclipse.org/org/documents/epl-v10.html *
|
|
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
|
* *
|
|
* Information and Software Systems Research *
|
|
* AT&T Research *
|
|
* Florham Park NJ *
|
|
* *
|
|
* Glenn Fowler <gsf@research.att.com> *
|
|
* David Korn <dgk@research.att.com> *
|
|
* Phong Vo <kpv@research.att.com> *
|
|
* *
|
|
***********************************************************************/
|
|
|
|
#include "stdhdr.h"
|
|
|
|
Sfio_t*
|
|
fdopen(int fd, const char* mode)
|
|
{
|
|
int flags;
|
|
|
|
if (fd < 0 || !(flags = _sftype(mode, NiL, NiL)))
|
|
return 0;
|
|
return sfnew(NiL, NiL, (size_t)SF_UNBOUND, fd, flags);
|
|
}
|