Mail Archives: djgpp-workers/1997/09/14/14:54:19
This solves a problem on Windows 95 when several programs try to open the
same file:
diff -c src/libc/posix/fcntl/open.c~0 src/libc/posix/fcntl/open.c
*** src/libc/posix/fcntl/open.c~0 Wed Jul 24 02:37:10 1996
--- src/libc/posix/fcntl/open.c Fri Apr 18 19:10:14 1997
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <libc/stubs.h>
***************
*** 39,44 ****
--- 40,53 ----
dmode = (*((&oflag)+1) & S_IWUSR) ? 0 : 1;
fd = _open(filename, oflag);
+
+ /* Under multi-taskers, such as Windows, our file might be open
+ by some other program with DENY-NONE sharing bit, which fails
+ the `_open' call above. Try again with DENY-NONE bit set,
+ unless some sharing bits were already set in the initial call. */
+ if (fd == -1
+ && ((oflag & (SH_DENYNO | SH_DENYRW | SH_DENYRD | SH_DENYWR)) == 0))
+ fd = _open(filename, oflag | SH_DENYNO);
if (fd == -1 && oflag & O_CREAT)
fd = _creat(filename, dmode);
fo: (texinfo). The GNU documentation format.
* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
* Knowledge Base: (kb).
The DJGPP Knowledge Base
* DJGPP FAQ: (djgppfaq).
Frequently Asked Questions (and their answers)
* GCC: (gcc).
The GNU C, C++, and Objective-C Compiler
* libc.a: (libc).
The Standard C Library Reference
* iostream: (iostream).
The C++ input/output facility. (in libiostream.a *and* libgpp.a)
* libgpp.a: (libgplus).
The g++ class library.
* make: (make).
Automatically build programs from Makefiles.
* GDB: (gdb).
The GNU Debugger.
* CPP: (cpp).
The GNU C-Preprocessor
* as: (as).
The GNU assembler
* ld: (ld).
The GNU linker
* Binutils: (binutils).
The GNU binary utilities "ar", "objcopy",
"objdump", "nm", "size", "strip", and "ranlib".
* Bison: (bison).
The GNU yacc-like parser generator
* Diff-utils: (diff).
GNU diff, cmp, and patch
* find: (find).
Find files on your hard drive
* Flex: (flex).
A fast scanner generator.
* gasp: (gasp).
GNU assembler's macro preprocessor
* gawk: (gawk).
GNU Awk
* GZip: (gzip).
The GNU compression filter
* Utilities: (utils).
Miscellaneous utilities that come with DJGPP.
* Text utilities: (textutils). GNU text utilities.
* cat: (textutils)cat invocation. Concatenate and write files.
* cksum: (textutils)cksum invocation. Print @sc{POSIX} CRC checksum.
* comm: (textutils)comm invocation. Compare sorted files by line.
* csplit: (textutils)csplit invocation. Split by context.
* cut: (textutils)cut invocation. Print selected parts of lines.
* expand: (textutils)expand invocation. Convert tabs to spaces.
* fmt: (textutils)fmt invocation. Reformat paragraph text.
* fold: (textutils)fold invocation. Wrap long input lines.
* head: (textutils)head invocation. Output the first part of files.
* join: (textutils)join invocation. Join lines on a common field.
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
* nl: (textutils)nl invocation. Number lines and write files.
* od: (textutils)od invocation. Dump files in octal, etc.
* paste: (textutils)paste invocation. Merge lines of files.
* pr: (textutils)pr invocation. Paginate or columnate files.
* sort: (textutils)sort invocation. Sort text files.
* split: (textutils)split invocation. Split into fixed-size pieces.
* sum: (textutils)sum invocation. Print traditional checksum.
* tac: (textutils)tac invocation. Reverse files.
* tail: (textutils)tail invocation. Output the last part of files.
* tr: (textutils)tr invocation. Translate characters.
* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
* uniq: (textutils)uniq invocation. Uniqify files.
* wc: (textutils)wc invocation. Byte, word, and line counts.
* File utilities: (fileutils). GNU file utilities.
* chgrp: (fileutils)chgrp invocation. Change file groups.
* chown: (fileutils)chown invocation. Change file owners/groups.
* chmod: (fileutils)chmod invocation. Change file permissions.
* cp: (fileutils)cp invocation. Copy files.
* dd: (fileutils)dd invocation. Copy and convert a file.
* df: (fileutils)df invocation. Report filesystem disk usage.
* dir: (fileutils)dir invocation. List directories briefly.
* dircolors: (fileutils)dircolors invocation. Color setup for ls.
* du: (fileutils)du invocation. Report on disk usage.
* install: (fileutils)install invocation. Copy and change attributes.
* ln: (fileutils)ln invocation. Make links between files.
* ls: (fileutils)ls invocation. List directory contents.
* mkdir: (fileutils)mkdir invocation. Create directories.
* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
* mknod: (fileutils)mknod invocation. Create special files.
* mv: (fileutils)mv invocation. Rename files.
* rm: (fileutils)rm invocation. Remove files.
* rmdir: (fileutils)rmdir invocation. Remove empty directories.
* sync: (fileutils)sync invocation. Synchronize memory and disk.
* touch: (fileutils)touch invocation. Change file timestamps.
* vdir: (fileutils)vdir invocation. List directories verbosely.
* Shell utilities: (sh-utils). GNU shell utilities.
* basename: (sh-utils)basename invocation. Strip directory and suffix.
* date: (sh-utils)date invocation. Print/set system date and time.
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
* echo: (sh-utils)echo invocation. Print a line of text.
* env: (sh-utils)env invocation. Modify the environment.
* expr: (sh-utils)expr invocation. Evaluate expressions.
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
* groups: (sh-utils)groups invocation. Print group names a user is in.
* hostname: (sh-utils)hostname invocation. Print or set system name.
* id: (sh-utils)id invocation. Print real/effective uid/gid.
* logname: (sh-utils)logname invocation. Print current login name.
* nice: (sh-utils)nice invocation. Modify scheduling priority.
* pathchk: (sh-utils)pathchk invocation. Check file name portability.
* printenv: (sh-utils)printenv invocation. Print environment variables.
* printf: (sh-utils)printf invocation. Format and print data.
* pwd: (sh-utils)pwd invocation. Print working directory.
* sleep: (sh-utils)sleep invocation. Delay for a specified time.
* stty: (sh-utils)stty invocation. Print/change terminal settings.
* su: (sh-utils)su invocation. Modify user and group id.
* tee: (sh-utils)tee invocation. Redirect to multiple files.
* test: (sh-utils)test invocation. File/string tests.
* true: (sh-utils)true invocation. Do nothing, successfully.
* tty: (sh-utils)tty invocation. Print terminal name.
* uname: (sh-utils)uname invocation. Print system information.
* users: (sh-utils)users invocation. Print current user names.
* who: (sh-utils)who invocation. Print who is logged in.
* whoami: (sh-utils)whoami invocation. Print effective user id.
* yes: (sh-utils)yes invocation. Print a string indefinitely.
* ID database: (id-utils). Identifier database utilities.
* mkid: (id-utils)mkid invocation. Creating an ID database.
* lid: (id-utils)lid invocation. Matching words and patterns.
* fid: (id-utils)fid invocation. Listing a file's tokens.
* fnid: (id-utils)fnid invocation. Looking up file names.
* xtokid: (id-utils)xtokid invocation. Testing mkid scanners.
TeX things
* DVI-to-Postscript: (dvips). Translating TeX DVI files to PostScript.
* Web2c: (web2c). TeX, Metafont, and companion programs.
* bibtex: (web2c)bibtex invocation. Maintaining bibliographies.
* dmp: (web2c)dmp invocation. Troff->MPX (MetaPost pictures).
* dvicopy: (web2c)dvicopy invocation. Virtual font expansion
* dvitomp: (web2c)dvitomp invocation. DVI to MPX (MetaPost pictures).
* dvitype: (web2c)dvitype invocation. DVI to human-readable text.
* gftodvi: (web2c)gftodvi invocation. Generic font proofsheets.
* gftopk: (web2c)gftopk invocation. Generic to packed fonts.
* gftype: (web2c)gftype invocation. GF to human-readable text.
* inimf: (web2c)inimf invocation. Initial Metafont.
* inimpost: (web2c)inimpost invocation. Initial MetaPost.
* initex: (web2c)initex invocation. Initial TeX.
* makempx: (web2c)makempx invocation. MetaPost label typesetting.
* mf: (web2c)mf invocation. Creating typeface families.
* mft: (web2c)mft invocation. Prettyprinting Metafont source.
* mltex: (web2c)MLTeX. Multi-lingual TeX.
* mpost: (web2c)mpost invocation. Creating technical diagrams.
* mpto: (web2c)mpto invocation. MetaPost label extraction.
* newer: (web2c)newer invocation. Compare modification times.
* patgen: (web2c)patgen invocation. Creating hyphenation patterns.
* pktogf: (web2c)pktogf invocation. Packed to generic fonts.
* pktype: (web2c)pktype invocation. PK to human-readable text.
* pltotf: (web2c)pltotf invocation. Property list to TFM.
* pooltype: (web2c)pooltype invocation. Display WEB pool files.
* tangle: (web2c)tangle invocation. WEB to Pascal.
* tex: (web2c)tex invocation. Typesetting.
* tftopl: (web2c)tftopl invocation. TFM -> property list.
* vftovp: (web2c)vftovp invocation. Virtual font -> virtual pl.
* virmf: (web2c)virmf invocation. Virgin Metafont.
* virmpost: (web2c)virmpost invocation. Virgin MetaPost.
* virtex: (web2c)virtex invocation. Virgin TeX.
* vptovf: (web2c)vptovf invocation. Virtual pl -> virtual font.
* weave: (web2c)weave invocation. WEB to TeX.
* afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX.
* dvips: (dvips)Invoking Dvips. DVI-to-PostScript translator.
* Kpathsearch: (kpathsea). File lookup along search paths.
* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
* MakeTeXMF: (kpathsea)MakeTeX scripts. MF source generation.
* MakeTeXPK: (kpathsea)MakeTeX scripts. PK bitmap generation.
* MakeTeXTeX: (kpathsea)MakeTeX scripts. TeX source generation.
* MakeTeXTFM: (kpathsea)MakeTeX scripts. TeX font metric generation.
* MakeTeXls-R: (kpathsea)Filename database. Update ls-R.
* m4: (m4).
A powerful macro processor.
* ed: (ed).
A simple text editor.
* Perl: (perl).
Practical extraction and report language.
* Autoconf: (autoconf).
Create source code configuration scripts.
* Gperf: (gperf).
Perfect Hash Function Generator.
* Indent: (indent).
Prettyprinter for programs.
@end menu
- Raw text -