Changeset 123
- Timestamp:
- May 12, 2003, 12:48:43 PM (22 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 25 added
- 23 deleted
- 205 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/Makefile
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 23 23 OUT = out/ 24 24 # Base installation directory 25 INS = out/ install/25 INS = out/$(MODE)/install/ 26 26 # CPU type (pretend we are portable ;-) 27 27 CPU = 386 28 # The object file format to use for tools (emxomf, ld and friends) 29 TOOLFMT.dbg = aout 30 TOOLFMT.opt = omf 31 TOOLFMT = $(TOOLFMT.$(MODE)) 28 32 29 33 # Use ash.exe which is quite fast (comparable to cmd.exe) but has more features … … 44 48 CC = gcc -c 45 49 # The C compiler flags 46 CFLAGS = -Wall -Iinclude -Isrc/include $(CFLAGS.$(MODE)) $(CFLAGS.KIND) 50 CFLAGS.INC = -Iinclude -Isrc/include 51 CFLAGS = -Wall -mstack-arg-probe -Zmt $(CFLAGS.INC) $(CFLAGS.$(MODE)) $(CFLAGS.KIND) 47 52 # The additional C compiler flags for different build modes 48 53 CFLAGS.opt = -s -O3 -fomit-frame-pointer … … 50 55 CFLAGS.aout = 51 56 CFLAGS.omf = -Zomf 52 CFLAGS.st =53 CFLAGS.mt = -Zmt54 57 CFLAGS.prof = -pg 55 58 # The object files are put in subdirectory objectformat-targetkind, … … 63 66 LD = gcc 64 67 # Linker flags 65 LDFLAGS = $(LDFLAGS.$(MODE)) $(LDFLAGS.KIND)68 LDFLAGS = -Zmt $(LDFLAGS.$(MODE)) $(LDFLAGS.KIND) 66 69 # Linker flags for different build modes 67 70 LDFLAGS.opt = -s … … 69 72 LDFLAGS.aout = 70 73 LDFLAGS.omf = -Zomf -Zsys -Zsmall-conv -Zlinker /PM:VIO 71 LDFLAGS.st = 72 LDFLAGS.mt = -Zmt 73 LDFLAGS.stp = -pg 74 LDFLAGS.mtp = -pg -Zmt 74 LDFLAGS.prof = -pg 75 75 # Linker flags for different kinds of target 76 76 LDFLAGS.KIND = $(foreach x,$(subst -, ,$(firstword $(subst /, ,$(subst $.,,$@)))),$(LDFLAGS.$x)) … … 88 88 ARFLAGS = crs 89 89 DO.LIBRARY = $(AR) $(ARFLAGS) $@ $(^O) 90 91 # How to create dependencies 92 MAKEDEP = makedep 93 MAKEDEPFLAGS = $(CFLAGS.INC) 94 DO.DEPS = $(MAKEDEP) $(MAKEDEPFLAGS) \ 95 -I$(subst $(SPACE), -I,$(sort $(dir $^))) -p$(@D)/ -c -S -f$@ $^ 96 97 # How to convert an a.out file to the OMF format 98 DO.AOUT2OMF = emxomf $(strip $1 -o) $@ $< 90 99 91 100 # How to filter just the object files from $^ … … 109 118 SEP := ========================================================================== 110 119 111 # How to remove a file120 # How to remove one or more files without questions 112 121 RM = rm -f $1 122 # How to remove one or more directories without questions 123 RMDIR = rm -rf $1 124 # How to copy several files to a directory 125 CP = cp $1 $2 113 126 # Miscelaneous tools 114 127 MKDIR = mkdir.exe -p $1 … … 117 130 ECHOIZE = $(subst $$,\$$,$1$(strip $(subst $(SPACE)$(COMMA),$(COMMA),$(foreach x,2 3 4 5 6 7 8 9,$(if $($x),$(COMMA) $($x)))))) 118 131 # How to output a text string (with appended newline) 119 # bird: skip the .exe and ash will use internal echo implementation which is way faster120 #ECHO = echo.exe "$(call ECHOIZE,$1,$2,$3,$4,$5,$6,$7,$8,$9)"121 132 ECHO = echo "$(call ECHOIZE,$1,$2,$3,$4,$5,$6,$7,$8,$9)" 122 133 # Same but append the text to a file (given with first argument) 123 # bird: skip the .exe and ash will use internal echo implementation which is way faster124 #FECHO = echo.exe "$(call ECHOIZE,$2,$3,$4,$5,$6,$7,$8,$9)" >> "$1"125 134 FECHO = echo "$(call ECHOIZE,$2,$3,$4,$5,$6,$7,$8,$9)" >> "$1" 126 135 # How to replace the source file extension with a .o extension … … 145 154 # Build rules (_@_ replaced by name of generated makefile) 146 155 RULES := 147 148 .PHONY: default help all clean install 156 # The list of dependency files 157 TARGDEPEND := 158 159 .PHONY: default help all clean install cleandep cleandepend dep depend depdone 149 160 .SUFFIXES: 150 .SUFFIXES: .c .cpp .asm .s .o .exe .dll .a .lib 161 .SUFFIXES: .c .cpp .asm .s .o .exe .dll .a .lib .obj 151 162 152 163 # Default target … … 172 183 @$(call ECHO, clean - remove all generated files (remove all built files)) 173 184 @$(call ECHO, install - generate a installation tree in $(INS)) 185 @$(call ECHO, dep - generate dependency files for all changed targets) 186 @$(call ECHO, cleandep - remove all dependency file) 174 187 @$(call ECHO,$(SEP)) 175 188 @$(call ECHO,There are a number of variables than can be set in the make) … … 181 194 @$(call ECHO,$(SEP)) 182 195 183 all: $( MODULES)196 all: $(TARGDIRS) $(MODULES) 184 197 185 198 clean: 186 rm -rf $(OUT) 187 188 install: $(INSDIRS) 199 $(call RMDIR,$(OUT)) 200 201 cleandep cleandepend: 202 $(call RM,$(TARGDEPEND)) 203 204 dep depend: 205 @$(MAKE) --no-print-directory BUILD_DEPS=1 depdone 206 207 depdone: 208 @$(call ECHO,Dependency files succesfully updated) 209 210 install: all $(INSDIRS) 189 211 $(DO.INSTALL) 190 212 191 $ (OUT) $. $(INSDIRS) $(TARGDIRS):213 $. $(INSDIRS) $(TARGDIRS): 192 214 $(call MKDIR,$@) 193 215 194 # bird: add rule for generating the rules. 195 rules: rules-rm $(OUT)genrules.smak 196 rules-rm: 197 @$(call RM,$(OUT)genrules.smak) 198 199 #$(OUT)genrules.smak: $(OUT) Makefile $(SUBMAK) 200 # bird: depeding on $(OUT) make it unstable. 201 $(OUT)genrules.smak: Makefile $(SUBMAK) 202 $(call MKDIR,$(@D)) 203 @$(call ECHO,Please wait, rebuilding make rules $@ ...) 216 $(OUT)genrules.smak: $(SUBMAK) # Makefile $(wildcard *.smak) 217 @$(call MKDIR,$(OUT)) 218 @$(call ECHO,Please wait, rebuilding make rules ...) 204 219 @$(call RM,$@) 205 220 @$(call FECHO,$@,# Autogenerated file -- DO NOT EDIT!) 206 221 @$(subst _@,$@,$(RULES)) 207 222 223 # The general a.out -> OMF conversion rule for object files 224 $.omf/%.obj: $.aout/%.o 225 $(call DO.AOUT2OMF) 226 227 # The general a.out -> OMF conversion rule for libraries 228 $.omf%.lib: $.aout%.a 229 $(call DO.AOUT2OMF) 230 208 231 -include $(OUT)genrules.smak 209 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/build.txt
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 95 95 'make help' in the module list section. 96 96 97 .MDEP - (optional) module dependencies. This is useful if current module 98 requires another module to be built first (e.g. a library). 99 97 100 .TARGET - The name of target (e.g. executable or library file name without dir). 98 101 For example: .TARGET=myfile.exe … … 100 103 .TKIND - (optional) The kind of target. It can consist of up to three 101 104 components, the first one defines the object file format (omf or aout, 102 if not defined defaults to omf), the second defines the threadness103 (st or mt, defaults to st), third can be 'prof' to build inprofiling mode.104 Example: .TKIND=omf stprof105 if not defined defaults to omf), the second can be 'prof' to build in 106 profiling mode. 107 Example: .TKIND=omf prof 105 108 106 109 .TDEP - Dependencies for target (not built from a source file). For example, … … 141 144 mklib.smak - this builder creates a library. It defines all rules required 142 145 for building all object files and then runs the librarian which binds all 143 object files together in a single library. 146 object files together in a single library. Besides, if the file format is 147 a.out, it also defines a target called '$(.MODULE)@omf' (e.g. for module 148 zzz it also defines a module called zzz@omf) which will build the OMF 149 library from its a.out counterpart by using emxomf. 144 150 145 151 Here is a simple example of a submakefile that will build a simple helloworld … … 195 201 files from a single source file they are put under different output directories 196 202 (e.g. single-threaded OMF object files go into $(OUT)/omf-st/ directory while 197 multi-threaded a.out object files with profiling go into $(OUT)/aout- mt-prof/203 multi-threaded a.out object files with profiling go into $(OUT)/aout-prof/ 198 204 directory). This way, you can have several targets that are built from the 199 205 same source files with different compilation options. -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/common.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 19 19 .tmp := omf 20 20 endif # neq ($(findstring aout,$(.TKIND)),) 21 ifneq ($(findstring mt,$(.TKIND)),)22 .tmp += mt23 else24 .tmp += st25 endif # neq ($(findstring mt,$(.TKIND)),)26 21 ifneq ($(findstring prof,$(.TKIND)),) 27 22 .tmp += prof … … 29 24 .TKIND := $(.tmp) 30 25 .TKIND.DIR := $(subst $(SPACE),-,$(.TKIND))/ 31 .tmp := 26 27 ifdef .TARGET 32 28 33 29 # .TARG is same as .TARGET except that it has a st/ or mt/ prefix … … 35 31 36 32 ifdef .INSDIR 37 DO.INSTALL += cp.exe $.$(.TARG) $(INS)$(.INSDIR)$(.TARGET)$(NL)33 DO.INSTALL += $(call CP,$.$(.TARG),$(INS)$(.INSDIR)$(.TARGET))$(NL) 38 34 INSDIRS += $(INS)$(.INSDIR) 39 35 endif # def .INSDIR 36 37 # We know how to create dependency files for .c and .cpp files 38 .tmp := $(strip $(filter %.c,$(.TSRC)) $(filter %.cpp,$(.TSRC))) 39 ifdef .tmp 40 # Read the dependency file 41 -include $.$(.TKIND.DIR)dep-$(.TARGET).smak 42 43 TARGDEPEND += $.$(.TKIND.DIR)dep-$(.TARGET).smak 44 45 ifdef BUILD_DEPS 46 # How to build the dependency file 47 $.$(.TKIND.DIR)dep-$(.TARGET).smak: $(.tmp) 48 $(DO.DEPS) 49 endif # BUILD_DEPS 50 endif # def .tmp 51 52 endif # def .TARGET 40 53 41 54 # If module has any source files, find respective object file names … … 47 60 TARGDIRS += $(.DIRS) 48 61 62 ifdef .MDEP 63 $(.MODULE): $(.MDEP) 64 .MDEP := 65 endif 66 67 ifdef .MODULE 49 68 $(.MODULE): $(.DIRS) $.$(.TARG) 69 endif 50 70 51 71 # Remove the names of files for which we already generated build rules … … 61 81 BUILD.RULES += $(.TSRC) 62 82 .TSRC := $(filter-out $(.OBJS),$(subst :, ,$(.TSRC))) 63 64 #.TSRC := $(foreach x,$(.TSRC),$(if $(findstring $(call OBJFILE,$x):$x,$(BUILD.RULES)),,$x))65 #BUILD.RULES += $(foreach x,$(.TSRC),$(if $(findstring $(call OBJFILE,$x):$x,$(BUILD.RULES)),,$(call OBJFILE,$x):$x))66 83 67 84 # Generate compilation rules for C files -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/ctype.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 46 46 #else 47 47 48 #define isalnum(c) ((_ctype+1)[ c] & (_UPPER|_LOWER|_DIGIT))49 #define isalpha(c) ((_ctype+1)[ c] & (_UPPER|_LOWER))50 #define iscntrl(c) ((_ctype+1)[ c] & (_CNTRL))51 #define isdigit(c) ((_ctype+1)[ c] & (_DIGIT))52 #define isgraph(c) ((_ctype+1)[ c] & (_PUNCT|_UPPER|_LOWER|_DIGIT))53 #define islower(c) ((_ctype+1)[ c] & (_LOWER))54 #define isprint(c) ((_ctype+1)[ c] & (_PRINT))55 #define ispunct(c) ((_ctype+1)[ c] & (_PUNCT))56 #define isspace(c) ((_ctype+1)[ c] & (_SPACE))57 #define isupper(c) ((_ctype+1)[ c] & (_UPPER))58 #define isxdigit(c) ((_ctype+1)[ c] & (_XDIGIT))48 #define isalnum(c) ((_ctype+1)[(unsigned char)c] & (_UPPER|_LOWER|_DIGIT)) 49 #define isalpha(c) ((_ctype+1)[(unsigned char)c] & (_UPPER|_LOWER)) 50 #define iscntrl(c) ((_ctype+1)[(unsigned char)c] & (_CNTRL)) 51 #define isdigit(c) ((_ctype+1)[(unsigned char)c] & (_DIGIT)) 52 #define isgraph(c) ((_ctype+1)[(unsigned char)c] & (_PUNCT|_UPPER|_LOWER|_DIGIT)) 53 #define islower(c) ((_ctype+1)[(unsigned char)c] & (_LOWER)) 54 #define isprint(c) ((_ctype+1)[(unsigned char)c] & (_PRINT)) 55 #define ispunct(c) ((_ctype+1)[(unsigned char)c] & (_PUNCT)) 56 #define isspace(c) ((_ctype+1)[(unsigned char)c] & (_SPACE)) 57 #define isupper(c) ((_ctype+1)[(unsigned char)c] & (_UPPER)) 58 #define isxdigit(c) ((_ctype+1)[(unsigned char)c] & (_XDIGIT)) 59 59 60 60 int (isalnum)(int); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/fnmatch.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 /* fnmatch.h (emx+gcc) */1 /* Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc. 2 2 3 #ifndef _FNMATCH_H 4 #define _FNMATCH_H 3 NOTE: The canonical source of this file is maintained with the GNU C Library. 4 Bugs can be reported to bug-glibc@prep.ai.mit.edu. 5 5 6 #if defined (__cplusplus) 6 This program is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License as published by the 8 Free Software Foundation; either version 2, or (at your option) any 9 later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, 59 Temple Place - Suite 330, 19 Boston, MA 02111-1307, USA. */ 20 21 #ifndef _FNMATCH_H 22 23 #define _FNMATCH_H 1 24 25 #ifdef __cplusplus 7 26 extern "C" { 8 27 #endif 9 28 10 /* POSIX.2 */ 11 12 #define FNM_NOMATCH 1 13 14 #define FNM_NOESCAPE 16 15 #define FNM_PATHNAME 32 16 #define FNM_PERIOD 64 17 18 int fnmatch (__const__ char *, __const__ char *, int); 29 #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) 30 #undef __P 31 #define __P(args) args 32 #else /* Not C++ or ANSI C. */ 33 #undef __P 34 #define __P(args) () 35 /* We can get away without defining `const' here only because in this file 36 it is used only inside the prototype for `fnmatch', which is elided in 37 non-ANSI C where `const' is problematical. */ 38 #endif /* C++ or ANSI C. */ 19 39 20 40 21 #if !defined (_POSIX_SOURCE) || defined (_WITH_UNDERSCORE) 41 /* We #undef these before defining them because some losing systems 42 (HP-UX A.08.07 for example) define these in <unistd.h>. */ 43 #undef FNM_PATHNAME 44 #undef FNM_NOESCAPE 45 #undef FNM_PERIOD 22 46 23 /* emx extensions */ 47 /* Bits set in the FLAGS argument to `fnmatch'. */ 48 #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ 49 #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ 50 #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ 24 51 25 #define _FNM_MATCH 0 26 #define _FNM_ERR 2 27 28 #define _FNM_STYLE_MASK 15 29 30 #define _FNM_POSIX 0 31 #define _FNM_OS2 1 32 #define _FNM_DOS 2 33 34 #define _FNM_IGNORECASE 128 35 #define _FNM_PATHPREFIX 256 36 37 int _fnmatch (__const__ char *, __const__ char *, int); 38 52 #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) 53 #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ 54 #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ 55 #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ 39 56 #endif 40 57 58 /* Value returned by `fnmatch' if STRING does not match PATTERN. */ 59 #define FNM_NOMATCH 1 41 60 42 #if defined (__cplusplus) 61 /* Match STRING against the filename pattern PATTERN, 62 returning zero if it matches, FNM_NOMATCH if not. */ 63 extern int fnmatch __P ((const char *__pattern, const char *__string, 64 int __flags)); 65 66 #ifdef __cplusplus 43 67 } 44 68 #endif 45 69 46 #endif /* not _FNMATCH_H*/70 #endif /* fnmatch.h */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/getopt.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 1 1 /* Declarations for getopt. 2 Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. 2 Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000 3 Free Software Foundation, Inc. 3 4 4 5 NOTE: The canonical source of this file is maintained with the GNU C Library. … … 100 101 101 102 #if defined (__STDC__) && __STDC__ 102 #ifdef __GNU_LIBRARY__ 103 /* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is 104 undefined, we haven't run the autoconf check so provide the 105 declaration without arguments. If it is 0, we checked and failed 106 to find the declaration so provide a fully prototyped one. If it 107 is 1, we found it so don't provide any declaration at all. */ 108 #if defined (__GNU_LIBRARY__) || (defined (HAVE_DECL_GETOPT) && !HAVE_DECL_GETOPT) 103 109 /* Many other libraries have conflicting prototypes for getopt, with 104 110 differences in the consts, in stdlib.h. To avoid compilation … … 106 112 extern int getopt (int argc, char *const *argv, const char *shortopts); 107 113 #else /* not __GNU_LIBRARY__ */ 114 # if !defined (HAVE_DECL_GETOPT) && !defined (__cplusplus) 108 115 extern int getopt (); 116 # endif 109 117 #endif /* __GNU_LIBRARY__ */ 110 118 extern int getopt_long (int argc, char *const *argv, const char *shortopts, -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/malloc.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/math.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stddef.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdio.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdlib.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/string.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/errno.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/fcntl.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/process.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/stat.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 6 6 #if !defined (_SYS_TYPES_H) 7 #warning <sys/stat.h> requires <sys/types.h>7 #warning <sys/stat.h> requires <sys/types.h> 8 8 #include <sys/types.h> 9 9 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/types.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 63 63 #if !defined (FD_SETSIZE) 64 64 #define FD_SETSIZE 256 65 #elif FD_SETSIZE < 256 66 #error FD_SETSIZE must be at least 256 65 #else 66 #if FD_SETSIZE < 256 67 #error FD_SETSIZE must be at least 256 68 #endif 67 69 #endif 68 70 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/wait.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/time.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/unistd.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
-
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/mklib.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 10 10 $(call FECHO,_@, $$(DO.LIBRARY))$(NL) 11 11 12 # The rule for building the OMF variant of library from a.out format 13 ifneq ($(findstring aout,$(.TKIND)),) 14 # Remove the .a suffix from library name 15 .TARGET := $(patsubst %$A,%,$(.TARGET)) 16 # Replace 'aout' with 'omf' in .TKIND 17 .TKIND := $(subst aout,omf,$(.TKIND)) 18 # Compute the new output file directory 19 .TKIND.DIR := $(subst $(SPACE),-,$(.TKIND))/ 20 # Append the .lib suffix to target name 21 .TARGET := $(.TARGET)$A 22 # Compute the name of target file to build 23 .TARG@OMF := $(.TKIND.DIR)$(.TARGET) 24 # The rule for building the xxx@omf variant of target 25 .PHONY: $(.MODULE)@omf 26 MODULES += $(.MODULE)@omf 27 DO.INSTALL += $(call CP,$.$(.TARG@OMF),$(INS)$(.INSDIR)$(.TARGET))$(NL) 28 .DIRS@OMF := $(dir $.$(.TARG@OMF)) 29 TARGDIRS += $(.DIRS@OMF) 30 $(.MODULE)@omf: $(.MODULE) $(.DIRS@OMF) $.$(.TARG@OMF) 31 endif # neq ($(findstring aout,$(.TKIND)),) 32 12 33 include comend.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/emxbind.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 .MODULE := emxbind 2 2 .MDESC := Build a OS/2 LX executable/dll from linked a.out module 3 .MDEP := moddef@omf 3 4 .INSDIR := bin/ 4 5 5 6 .TARGET := emxbind.exe 7 .TKIND := $(TOOLFMT) 6 8 .TSRC := $(wildcard src/emxbind/*.c) 7 9 .TCF := -DLIST_OPT=1 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxexp/emxexp.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 .MODULE := emxexp 2 2 .MDESC := Generate a list of DLL export entries 3 .MDEP := omflib@omf 3 4 .INSDIR := bin/ 4 5 5 6 .TARGET := emxexp.exe 7 .TKIND := $(TOOLFMT) 6 8 .TSRC := $(wildcard src/emxexp/*.c) 7 .TLDF := -liberty -lomflib 9 .TDEP := @O@omflib$A 10 .TLDF := -liberty 8 11 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emximp/emximp.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 .MODULE := emximp 2 2 .MDESC := Import library management tool 3 .MDEP := omflib@omf moddef@omf 3 4 .INSDIR := bin/ 4 5 5 6 .TARGET := emximp.exe 7 .TKIND := $(TOOLFMT) 6 8 .TSRC := $(wildcard src/emximp/*.c) 7 .T LDF := -lomflib -lmoddef9 .TDEP := @O@omflib$A @O@moddef$A 8 10 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomf.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := a.out to OMF object file conversion utility 3 3 .INSDIR := bin/ 4 .MDEP := omflib@omf moddef@omf 4 5 5 6 .TARGET := emxomf.exe 7 .TKIND := $(TOOLFMT) 6 8 .TSRC := $(addprefix src/emxomf/,emxomf.c stabshll.c grow.c) 7 .T LDF := -lomflib9 .TDEP := @O@omflib$A 8 10 include mkexe.smak 9 11 10 12 .TARGET := emxomfar.exe 13 .TKIND := $(TOOLFMT) 11 14 .TSRC := src/emxomf/emxomfar.c 12 .T LDF := -lomflib15 .TDEP := @O@omflib$A 13 16 include mkexe.smak 14 17 15 18 .TARGET := emxomfld.exe 19 .TKIND := $(TOOLFMT) 16 20 .TSRC := src/emxomf/emxomfld.c 17 .T LDF := -lmoddef21 .TDEP := @O@moddef$A 18 22 include mkexe.smak 19 23 20 24 .TARGET := emxaout.exe 25 .TKIND := $(TOOLFMT) 21 26 .TSRC := $(addprefix src/emxomf/,emxaout.c grow.c) 22 27 include mkexe.smak 23 28 24 29 .TARGET := listomf.exe 30 .TKIND := $(TOOLFMT) 25 31 .TSRC := src/emxomf/listomf.c 26 32 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxstack/emxstack.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 5 5 .TARGET := emxstack.exe 6 .TKIND := $(TOOLFMT) 6 7 .TSRC := $(wildcard src/emxstack/*.c) 7 8 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxtsf/emxtsf.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 .MODULE := emxtsf 2 2 .MDESC := Simplify construction of .TSF files 3 .MDEP := moddef@omf 3 4 .INSDIR := bin/ 4 5 5 6 .TARGET := emxtsf.exe 7 .TKIND := $(TOOLFMT) 6 8 .TSRC := $(wildcard src/emxtsf/*.c) 7 9 .TLDF := -lmoddef -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/ld/ld.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 29 29 #include <process.h> /* for running emxbind */ 30 30 #include <errno.h> 31 #include <utime.h> 31 32 #endif /* __EMX__ */ 33 #include <ctype.h> 32 34 #include <sys/types.h> 33 35 #include <sys/stat.h> … … 81 83 #define FIXSETBUG 82 84 85 extern int DosCopy (char *, char *, int); 83 86 #endif /* EMX */ 84 87 … … 1109 1112 1110 1113 int parse (); 1111 void do_warnings ();1112 1114 void initialize_text_start (); 1113 1115 void initialize_data_start (); … … 1132 1134 char *get_file_name (); 1133 1135 symbol *getsym (), *getsym_soft (); 1136 void do_warnings (); 1134 1137 #ifdef EMX /* emxbind */ 1135 1138 void check_exe (void); … … 1144 1147 #ifdef __EMX__ 1145 1148 _response (&argc, &argv); 1149 _wildcard (&argc, &argv); 1146 1150 #endif /* __EMX__ */ 1147 1151 page_size = getpagesize (); … … 1822 1826 1823 1827 perror_file (entry); 1828 /* NOTREACHED */ 1824 1829 return -1; 1825 1830 } … … 2877 2882 /* Handle a subentry for a file with no __.SYMDEF. */ 2878 2883 2879 void process_subentry (desc, subentry, entry, prev_addr) 2884 void 2885 process_subentry (desc, subentry, entry, prev_addr) 2880 2886 int desc; 2881 2887 register struct file_entry *subentry; … … 3051 3057 { 3052 3058 register int i; 3053 int setv_fill_count = 0;3059 int setv_fill_count; 3054 3060 3055 3061 if (trace_files) … … 3433 3439 fprintf (outfile, "\nFiles:\n\n"); 3434 3440 3435 each_file (describe_file_sections, (int)outfile);3441 each_file (describe_file_sections, outfile); 3436 3442 3437 3443 fprintf (outfile, "\nGlobal symbols:\n\n"); … … 3451 3457 } 3452 3458 3453 each_file (list_file_locals, (int)outfile);3459 each_file (list_file_locals, outfile); 3454 3460 } 3455 3461 … … 3868 3874 struct line_debug_entry *text_scan, *data_scan; 3869 3875 int i; 3870 char *errfmt, *file_name = NULL;3871 int line_number = -1;3876 char *errfmt, *file_name; 3877 int line_number; 3872 3878 int dont_allow_symbol_name; 3873 3879 … … 4016 4022 return; 4017 4023 4018 each_file (do_file_warnings, (int)outfile);4024 each_file (do_file_warnings, outfile); 4019 4025 4020 4026 if (list_unresolved_refs || list_multiple_defs) … … 4041 4047 initialize_a_out_text_start () 4042 4048 { 4043 int magic = 0;4049 int magic; 4044 4050 4045 4051 switch (output_style) … … 5043 5049 { 5044 5050 char execname[512]; 5045 _execname( (char *)&execname, sizeof(execname));5046 strcpy(_getname( (char *)&execname), "ldstub.bin");5051 _execname(execname, sizeof (execname)); 5052 strcpy(_getname(execname), "ldstub.bin"); 5047 5053 /* Copy stub into file */ 5048 if (DosCopy( (char *)&execname, touch_filename, 4))5054 if (DosCopy(execname, touch_filename, 4)) 5049 5055 { 5050 5056 errno = EACCES; … … 5719 5725 5720 5726 #ifdef EMX 5721 if ( symtype = symptr->defined!= (N_IMP1 | N_EXT))5727 if ((symtype = symptr->defined) != (N_IMP1 | N_EXT)) 5722 5728 #endif 5723 5729 symtype = symptr->defined & ~N_EXT; … … 5883 5889 /* Write the local symbols defined by the various files. */ 5884 5890 5885 each_file (write_file_syms, (int)&syms_written);5891 each_file (write_file_syms, &syms_written); 5886 5892 file_close (); 5887 5893 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/ld/ld.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 7 7 .TARGET := ld.exe 8 .TKIND := $(TOOLFMT) 8 9 .TSRC := $(wildcard src/ld/*.c) 10 .TCF := -DEMX 9 11 .TLDF := -liberty 10 12 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/app/app.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := EMX.DLL 'replacement' for statically linked programs 3 3 4 # Build four kinds of library c_app: single-threaded, multi-threaded,5 # single-threaded profile and multi-threaded profile4 # Build two kinds of library: aout and aout-profile. 5 # The OMF libraries will be derived from them. 6 6 7 .TKIND := aout st7 .TKIND := aout 8 8 .TARGET := c_app$A 9 9 .TSRC.386 := $(addprefix 386/,crt2.s crt3.s emxio.s inp8.s inp16.s inp32.s \ … … 14 14 .TCF.src/lib/app/stdio.c := -D_NFILES=40 15 15 .TCF.src/lib/app/iodata.c := -D_NFILES=40 16 .INSDIR = lib/ $(filter st mt,$(.TKIND))/16 .INSDIR = lib/ 17 17 .TKEEP := 1 18 18 include mklib.smak 19 19 20 .TKIND := aout mt21 .T KEEP := 120 .TKIND := aout prof 21 .TARGET := c_app_p$A 22 22 include mklib.smak 23 24 .TKIND := aout st prof25 .TARGET := c_app_p$A26 .TKEEP := 127 include mklib.smak28 29 .TKIND := aout mt prof30 include mklib.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/emxload/emxloadl.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 8 8 int _emxload_list_start (void) 9 9 { 10 if (_osmode != OS2_MODE)11 return -1;12 10 if (_emxload_do_connect (FALSE) != 0) 13 11 return -1; … … 25 23 answer ans; 26 24 27 if ( _osmode != OS2_MODE ||buf_size == 0)25 if (buf_size == 0) 28 26 return -1; 29 27 if (_emxload_do_receive (&ans) != 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/emxload/emxloadr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 144 144 int result; 145 145 146 if (_osmode != OS2_MODE)147 return -1;148 146 switch (req_code) 149 147 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/end/end.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := The C runtime library that should be linked last 3 3 4 .TKIND := omf st4 .TKIND := omf 5 5 .TARGET := end$A 6 6 .TSRC.386 := $(wildcard src/lib/end/386/*.asm) 7 7 .TSRC := $(.TSRC.$(CPU)) 8 8 .INSDIR = lib/ 9 .TKEEP := 110 9 include mklib.smak 11 12 .TKIND := omf mt13 include mklib.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_imphand.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 8 8 #include <emx/syscalls.h> 9 9 10 int _fmode_bin;10 extern int _fmode_bin; 11 11 12 12 int _imphandle (int handle) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/access.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 8 8 #include <emx/syscalls.h> 9 9 10 int _access (const char *name, int mode)10 int access (const char *name, int mode) 11 11 { 12 12 int a, slash; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/chmod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 int _chmod (const char *name, int pmode)9 int chmod (const char *name, int pmode) 10 10 { 11 11 int attr, rc; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/chsize.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 int _chsize (int handle, long length)9 int chsize (int handle, long length) 10 10 { 11 11 long n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/close.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 int _close (int handle)8 int close (int handle) 9 9 { 10 10 if (_fd_flags (handle) == NULL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/creat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <fcntl.h> 5 5 6 int _creat (const char *name, int pmode)6 int creat (const char *name, int pmode) 7 7 { 8 8 return _open (name, O_WRONLY|O_TRUNC|O_CREAT, pmode); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/dup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 int _dup (int handle)8 int dup (int handle) 9 9 { 10 10 int new, *pflags1, *pflags2, *pla1, *pla2; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/dup2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 int _dup2 (int handle1, int handle2)8 int dup2 (int handle1, int handle2) 9 9 { 10 10 int *pflags1, *pflags2, *pla1, *pla2; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadread.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 66 66 67 67 _ead_clear (ead); 68 if (_osmode != OS2_MODE)69 {70 if (path != NULL)71 {72 if (_access (path, 0) != 0)73 return -1;74 }75 else76 {77 if (_tell (handle) == -1)78 return -1;79 }80 return 0;81 }82 68 gd.gea_alloc = sizeof (GEA2LIST); 83 69 gd.gea_ptr = malloc (gd.gea_alloc); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadwrite.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 51 51 int _ead_write (_ead ead, const char *path, int handle, int flags) 52 52 { 53 if (_osmode != OS2_MODE)54 return 0;55 53 if (!(flags & _EAD_MERGE)) 56 54 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eaget.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 26 26 dst->size = 0; 27 27 dst->value = NULL; 28 if (_osmode != OS2_MODE)29 {30 if (path != NULL)31 {32 if (_access (path, 0) != 0)33 return -1;34 }35 else36 {37 if (_tell (handle) == -1)38 return -1;39 }40 return 0;41 }42 28 if (path != NULL) 43 29 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eaput.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 18 18 int len, size; 19 19 20 if (_osmode != OS2_MODE)21 return 0;22 20 len = strlen (name); 23 21 size = sizeof (FEA2LIST) + len + src->size; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eof.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/io.h> 6 6 7 int _eof (int handle)7 int eof (int handle) 8 8 { 9 9 int *pflags; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fcloseal.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/io.h> 5 5 6 int _fcloseall (void)6 int fcloseall (void) 7 7 { 8 8 int i, n, start; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fcntl.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 60 60 61 61 62 int _fcntl (int handle, int request, ...)62 int fcntl (int handle, int request, ...) 63 63 { 64 64 va_list va; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fdopen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 12 12 /* Bug: doesn't check for compatible modes (O_ACCMODE) */ 13 13 14 FILE * _fdopen (int handle, const char *mode)14 FILE *fdopen (int handle, const char *mode) 15 15 { 16 16 char ok, bt; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fgetchar.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdio.h> 4 4 5 int _fgetchar (void)5 int fgetchar (void) 6 6 { 7 7 return getchar (); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fileleng.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 long _filelength (int handle)6 long filelength (int handle) 7 7 { 8 8 long cur, n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/flock.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/io.h> 6 6 7 int _flock (int handle, int operation)7 int flock (int handle, int operation) 8 8 { 9 9 if (_fd_flags (handle) == NULL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/flushall.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <sys/rmutex.h> 6 6 #include <stdio.h> 7 #include <stdlib.h> 7 8 #include <emx/io.h> 8 9 9 int _flushall (void)10 int flushall (void) 10 11 { 11 12 int i, n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fputchar.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdio.h> 4 4 5 int _fputchar (int c)5 int fputchar (int c) 6 6 { 7 7 return putchar (c); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fstat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 8 8 #include <emx/syscalls.h> 9 9 10 int _fstat (int handle, struct stat *buffer)10 int fstat (int handle, struct stat *buffer) 11 11 { 12 12 int rc; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fsync.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 int _fsync (int handle)6 int fsync (int handle) 7 7 { 8 8 return __fsync (handle); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/ftruncat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 int _ftruncate (int handle, long length)8 int ftruncate (int handle, long length) 9 9 { 10 10 int *pflags; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/getw.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdio.h> 4 4 5 int _getw (FILE *stream)5 int getw (FILE *stream) 6 6 { 7 7 int x; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/io.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 libc.TSRC += $(wildcard src/lib/io/*.c) 2 3 # Build some object files separately (not included in libraries) 4 .MODULE := 5 .TKIND := aout 6 .TSRC.386 := src/lib/io/386/binmode.s 7 .TSRC := $(.TSRC.$(CPU)) 8 include common.smak 9 10 .OBJS += $(patsubst %.o,%.obj,$(subst /aout/,/omf/,$(.OBJS))) 11 .DIRS := $(sort $(dir $(.OBJS))) 12 TARGDIRS += $(.DIRS) 13 14 DO.INSTALL += $(call CP,$(.OBJS) $(INS)lib/)$(NL) 15 16 libc: $(.DIRS) $(.OBJS) 17 18 include comend.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/ioctl.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 14 14 #define FIONBIO 0x667e 15 15 16 int _ioctl (int handle, int request, ...)16 int ioctl (int handle, int request, ...) 17 17 { 18 18 va_list va; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/isatty.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/io.h> 6 6 7 int _isatty (int handle)7 int isatty (int handle) 8 8 { 9 9 int *pflags; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/lseek.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 long _lseek (int handle, long offset, int origin)8 long lseek (int handle, long offset, int origin) 9 9 { 10 10 int *pflags, *pla; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/mkstemp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <errno.h> 8 8 9 int _mkstemp (char *string)9 int mkstemp (char *string) 10 10 { 11 11 int fd, pid, n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/mktemp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <errno.h> 7 7 8 char * _mktemp (char *string)8 char *mktemp (char *string) 9 9 { 10 10 int pid, n, saved_errno; 11 11 char *s; 12 12 13 pid = _getpid ();13 pid = getpid (); 14 14 s = strchr (string, 0); 15 15 n = 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/open.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/io.h> 7 7 8 int _open (const char *name, int oflag, ...)8 int open (const char *name, int oflag, ...) 9 9 { 10 10 va_list va; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/pclose.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/io.h> 7 7 8 int _pclose (FILE *stream)8 int pclose (FILE *stream) 9 9 { 10 10 int rc, write_mode; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/pipe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 int _fmode_bin;9 extern int _fmode_bin; 10 10 int _pipe_size; 11 11 12 int _pipe (int *two_handles)12 int pipe (int *two_handles) 13 13 { 14 14 int *pflags1, *pflags2; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/popen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 82 82 83 83 84 FILE * _popen (const char *command, const char *mode)84 FILE *popen (const char *command, const char *mode) 85 85 { 86 86 int ph[2]; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/putw.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdio.h> 4 4 5 int _putw (int x, FILE *stream)5 int putw (int x, FILE *stream) 6 6 { 7 7 return (fwrite (&x, sizeof (x), 1, stream) == 1 ? x : EOF); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/read.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 37 37 38 38 39 int _read (int handle, void *buf, size_t nbyte)39 int read (int handle, void *buf, size_t nbyte) 40 40 { 41 41 int n, *pflags, *pla; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/readv.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 10 10 #include <sys/uio.h> 11 11 12 int _readv (int handle, const struct iovec *iov, int iovcnt)12 int readv (int handle, const struct iovec *iov, int iovcnt) 13 13 { 14 14 int i, n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/select.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 12 12 #define MIN(a,b) (((a) < (b)) ? (a) : (b)) 13 13 14 int _select (int nfds, fd_set *readfds, fd_set *writefds,14 int select (int nfds, fd_set *readfds, fd_set *writefds, 15 15 fd_set *exceptfds, struct timeval *timeout) 16 16 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/setbuffe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdio.h> 4 4 5 int _setbuffer (FILE *stream, char *buffer, size_t size)5 int setbuffer (FILE *stream, char *buffer, size_t size) 6 6 { 7 7 return setvbuf (stream, buffer, (buffer != NULL ? _IOFBF : _IONBF), size); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/setmode.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/io.h> 7 7 8 int _setmode (int handle, int mode)8 int setmode (int handle, int mode) 9 9 { 10 10 int old_mode, *pflags; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/snprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/io.h> 7 7 8 int _snprintf (char *buffer, size_t n, const char *format, ...)8 int snprintf (char *buffer, size_t n, const char *format, ...) 9 9 { 10 10 va_list arg_ptr; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/sopen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/io.h> 6 6 7 int _sopen (const char *name, int oflag, int shflag, ...)7 int sopen (const char *name, int oflag, int shflag, ...) 8 8 { 9 9 va_list va; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/stat.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 13 13 #include <emx/syscalls.h> 14 14 15 int _stat (const char *name, struct stat *buffer)15 int stat (const char *name, struct stat *buffer) 16 16 { 17 17 int rc, slash; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/tell.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 long _tell (int handle)8 long tell (int handle) 9 9 { 10 10 int *pflags, *pla; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/truncate.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <fcntl.h> 5 5 6 int _truncate (char *name, long length)6 int truncate (char *name, long length) 7 7 { 8 8 int handle, result; 9 9 10 handle = _open (name, O_RDWR);10 handle = open (name, O_RDWR); 11 11 if (handle == -1) 12 12 return -1; 13 13 result = _ftruncate (handle, length); 14 _close (handle);14 close (handle); 15 15 return result; 16 16 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/ttyname.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/thread.h> 6 6 7 char * _ttyname (int handle)7 char *ttyname (int handle) 8 8 { 9 9 #if defined (__MT__) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/umask.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 int _umask (int pmode)6 int umask (int pmode) 7 7 { 8 8 return __umask (pmode); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/unlink.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 int _unlink (const char *name)6 int unlink (const char *name) 7 7 { 8 8 return __remove (name); /* There are no links */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/utime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 int _utime (const char *name, const struct utimbuf *times)9 int utime (const char *name, const struct utimbuf *times) 10 10 { 11 11 struct timeval tv[2]; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/utimes.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 int _utimes (const char *name, const struct timeval *tvp)8 int utimes (const char *name, const struct timeval *tvp) 9 9 { 10 10 struct timeval tv[2]; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/vsnprint.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/io.h> 6 6 7 int _vsnprintf (char *buffer, size_t n, const char *format, va_list arg_ptr)7 int vsnprintf (char *buffer, size_t n, const char *format, va_list arg_ptr) 8 8 { 9 9 FILE trick; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/vsscanf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdio.h> 4 4 #include <stdarg.h> 5 #include <string.h> 5 6 #include <limits.h> 6 7 #include <emx/io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/write.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 137 137 138 138 139 int _write (int handle, const void *buf, size_t nbyte)139 int write (int handle, const void *buf, size_t nbyte) 140 140 { 141 141 int n, *pflags; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/writev.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 10 10 #include <sys/uio.h> 11 11 12 int _writev (int handle, const struct iovec *iov, int iovcnt)12 int writev (int handle, const struct iovec *iov, int iovcnt) 13 13 { 14 14 int i, n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 # Utility function used in second-level submakefiles 4 4 # Creates four versions of object file name for all kinds of outputs. 5 .MVER = $(foreach x,aout -st aout-mt aout-st-prof aout-mt-prof,$.$x/src/lib/$1)5 .MVER = $(foreach x,aout aout-prof,$.$x/src/lib/$1) 6 6 7 7 # First of all, include all second-level libc submakefiles … … 14 14 .MDESC := The C library 15 15 16 .TKIND := aout st16 .TKIND := aout 17 17 .TARGET := c$A 18 18 .TSRC := $(libc.TSRC.$(CPU)) $(libc.TSRC) 19 .TDEP := $(libc.TDEP )20 .INSDIR = lib/ $(filter st mt,$(.TKIND))/19 .TDEP := $(libc.TDEP.$(CPU)) $(libc.TDEP) 20 .INSDIR = lib/ 21 21 .TKEEP := 1 22 22 include mklib.smak 23 23 24 .TKIND := aout mt 25 .TKEEP := 1 26 include mklib.smak 27 28 .TKIND := aout st prof 24 .TKIND := aout prof 29 25 .TARGET := c_p$A 30 .TKEEP := 131 include mklib.smak32 33 .TKIND := aout mt prof34 26 include mklib.smak 35 27 … … 38 30 libc.TSRC.$(CPU) := 39 31 libc.TSRC := 32 libc.TDEP.$(CPU) := 40 33 libc.TDEP := -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/math.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 libc.TSRC.386 += $(wildcard src/lib/math/386/*.s) 2 2 libc.TSRC += $(wildcard src/lib/math/*.c) 3 4 # Virtual targets, e.g. compiled from same input files but with different opts 5 libc.TDEP.386 += $(addprefix @O@src/lib/math/386/, copysigf.o copysigl.o \ 6 fpclassf.o fpclassl.o isfinf.o isfinl.o isnanf.o isnanl.o isnormf.o \ 7 isnorml.o nextaftf.o nextaftl.o signbitf.o signbitl.o acosl.o asinl.o \ 8 atanl.o atan2l.o ceill.o cosl.o coshl.o expl.o fabsl.o floorl.o fmodl.o \ 9 frexpl.o fxaml.o hypotl.o ldexpl.o logl.o log10l.o modfl.o powl.o rintl.o \ 10 sinl.o sinhl.o sqrtl.o tanl.o tanhl.o truncl.o) 11 12 $(call .MVER,math/%f.o): src/lib/math/%.s 13 $(call DO.COMPILE.s, -DFLOAT) 14 $(call .MVER,math/%l.o): src/lib/math/%.s 15 $(call DO.COMPILE.s, -DLONG_DOUBLE) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/386/int86.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 27 27 movl 5*4(%ebx), %edi 28 28 movl 1*4(%ebx), %ebx 29 call (%esp)/* "call %esp" is undefined */29 call *(%esp) /* "call %esp" is undefined */ 30 30 movl %ebx, 1*4(%esp) 31 31 movl 9*4(%esp), %ebx /* out_regs */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/386/setjmp.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 30 30 movl 0*4(%esp), %eax /* return address */ 31 31 movl %eax, J_EIP(%edx) 32 cmpb $0, __osmode /* OS/2? */33 je 1f /* No -> skip */34 32 fs 35 33 movl 0, %eax /* Exception handler */ 36 34 movl %eax, J_XCP(%edx) 37 1:xorl %eax, %eax35 xorl %eax, %eax 38 36 EPILOGUE(setjmp) 39 37 … … 44 42 _longjmp: 45 43 PROFILE_NOFRAME 46 cmpb $0, __osmode /* OS/2? */47 je 2f /* No -> skip */48 44 movl 1*4(%esp), %eax /* there */ 49 45 pushl J_XCP(%eax) 50 46 call ___unwind2 /* unwind signal handlers */ 51 47 addl $4, %esp 52 2:movl 1*4(%esp), %edx /* there */48 movl 1*4(%esp), %edx /* there */ 53 49 movl 2*4(%esp), %eax /* n */ 54 50 testl %eax, %eax -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/386/sigsetjm.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 32 32 movl 0*4(%esp), %eax /* return address */ 33 33 movl %eax, J_EIP(%edx) 34 cmpb $0, __osmode /* OS/2? */35 je 1f /* No -> skip */36 34 fs 37 35 movl 0, %eax /* Exception handler */ 38 36 movl %eax, J_XCP(%edx) 39 1:movl 2*4(%esp), %eax /* savemask */37 movl 2*4(%esp), %eax /* savemask */ 40 38 movl %eax, J_SAVE(%edx) 41 39 testl %eax, %eax 42 je 2f40 je 1f 43 41 leal J_MASK(%edx), %eax 44 42 pushl %eax /* oset */ … … 47 45 call __sigprocmask 48 46 addl $12, %esp 49 2: xorl %eax, %eax47 1: xorl %eax, %eax 50 48 EPILOGUE(_sigsetjmp) 51 49 … … 65 63 call __sigprocmask 66 64 addl $12, %esp 67 1: cmpb $0, __osmode /* OS/2? */ 68 je 2f /* No -> skip */ 69 movl 1*4(%esp), %eax /* there */ 65 1: movl 1*4(%esp), %eax /* there */ 70 66 pushl J_XCP(%eax) 71 67 call ___unwind2 /* unwind signal handlers */ 72 68 addl $4, %esp 73 2:movl 1*4(%esp), %edx /* there */69 movl 1*4(%esp), %edx /* there */ 74 70 movl 2*4(%esp), %eax /* n */ 75 71 testl %eax, %eax 76 jne 3f72 jne 2f 77 73 incl %eax 78 3: movl J_EBX(%edx), %ebx74 2: movl J_EBX(%edx), %ebx 79 75 movl J_ESI(%edx), %esi 80 76 movl J_EDI(%edx), %edi -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/abort.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 15 15 and SIGABRT is not blocked: do not yet call _cleanup(). */ 16 16 17 if ( _sigaction (SIGABRT, NULL, &act) == 017 if (sigaction (SIGABRT, NULL, &act) == 0 18 18 && act.sa_handler != SIG_IGN && act.sa_handler != SIG_DFL 19 && _sigemptyset (&set) == 020 && _sigprocmask (SIG_SETMASK, NULL, &set) == 021 && _sigismember (&set, SIGABRT) == 0)19 && sigemptyset (&set) == 0 20 && sigprocmask (SIG_SETMASK, NULL, &set) == 0 21 && sigismember (&set, SIGABRT) == 0) 22 22 { 23 23 /* Raise SIGABRT. Note that this is not guaranteed to terminate … … 30 30 31 31 act.sa_handler = SIG_DFL; 32 _sigemptyset (&act.sa_mask);32 sigemptyset (&act.sa_mask); 33 33 act.sa_flags = 0; 34 _sigaction (SIGABRT, &act, NULL);34 sigaction (SIGABRT, &act, NULL); 35 35 36 36 /* Clean up the C library only once. */ … … 41 41 /* Unblock SIGABRT. */ 42 42 43 _sigemptyset (&set);44 _sigaddset (&set, SIGABRT);45 _sigprocmask (SIG_UNBLOCK, &set, NULL);43 sigemptyset (&set); 44 sigaddset (&set, SIGABRT); 45 sigprocmask (SIG_UNBLOCK, &set, NULL); 46 46 47 47 /* Raise SIGABRT again. */ … … 51 51 /* This should not get reached. */ 52 52 53 _exit (3);53 exit (3); 54 54 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/alarm.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 unsigned _alarm (unsigned sec)6 unsigned alarm (unsigned sec) 7 7 { 8 8 return __alarm (sec); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/brk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 void * _brk (void *addr)6 void *brk (void *addr) 7 7 { 8 8 return __brk (addr); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/chdir.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 int _chdir (const char *name)8 int chdir (const char *name) 9 9 { 10 10 size_t len; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/cuserid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <string.h> 6 6 7 char * _cuserid (char *buffer)7 char *cuserid (char *buffer) 8 8 { 9 9 static char tmp_name[L_cuserid]; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/dirent.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 37 37 const char *base); 38 38 39 int _closedir (DIR *dirp)39 int closedir (DIR *dirp) 40 40 { 41 41 free_dircontents (dirp->dd_contents); … … 45 45 46 46 47 struct dirent * _readdir (DIR *dirp)47 struct dirent *readdir (DIR *dirp) 48 48 { 49 49 if (dirp->dd_cp == NULL) … … 65 65 66 66 67 void _seekdir (DIR *dirp, long off)67 void seekdir (DIR *dirp, long off) 68 68 { 69 69 long i; … … 83 83 84 84 85 void _rewinddir (DIR *dirp)85 void rewinddir (DIR *dirp) 86 86 { 87 87 _seekdir (dirp, 0L); … … 89 89 90 90 91 long _telldir (DIR *dirp)91 long telldir (DIR *dirp) 92 92 { 93 93 return dirp->dd_loc; … … 95 95 96 96 97 DIR * _opendir (const char *name)97 DIR *opendir (const char *name) 98 98 { 99 99 struct stat statb; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/dtread.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 170 170 data.dir_pass = 1; 171 171 if (strcmp (mask, "*.*") == 0 172 || ( _osmode == OS2_MODE &&strcmp (mask, "*") == 0))172 || (strcmp (mask, "*") == 0)) 173 173 data.dir_pass = 0; 174 174 data.attr = A_HIDDEN | A_SYSTEM; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fnmatch.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <string.h> 4 4 #include <ctype.h> 5 #include < fnmatch.h>5 #include <emx/fnmatch.h> 6 6 #include <sys/nls.h> 7 7 … … 592 592 /* This is the public entrypoint, with signed arguments. */ 593 593 594 int _fnmatch (const char *mask, const char *name, int flags)594 int fnmatch (const char *mask, const char *name, int flags) 595 595 { 596 596 return _fnmatch_unsigned (mask, name, flags); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fpathcon.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 /* Return the POSIX.1 minimum values, for now. */ 8 8 9 long _fpathconf (int handle, int name)9 long fpathconf (int handle, int name) 10 10 { 11 11 switch (name) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/ftw.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 66 66 67 67 68 int _ftw (const char *path,69 70 68 int ftw (const char *path, 69 int (*fn)(const char *name, const struct stat *stat_ptr, int flag), 70 int depth) 71 71 { 72 72 struct stat st; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getcwd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 char * _getcwd (char *buffer, size_t size)9 char *getcwd (char *buffer, size_t size) 10 10 { 11 11 char tmp[MAXPATHLEN+1]; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getegid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <sys/types.h> 5 5 6 gid_t _getegid (void)6 gid_t getegid (void) 7 7 { 8 8 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/geteuid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <sys/types.h> 5 5 6 uid_t _geteuid (void)6 uid_t geteuid (void) 7 7 { 8 8 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getgid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <sys/types.h> 5 5 6 gid_t _getgid (void)6 gid_t getgid (void) 7 7 { 8 8 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getgrgid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 /* Dummy function */ 8 8 9 struct group * _getgrgid (gid_t gid)9 struct group *getgrgid (gid_t gid) 10 10 { 11 11 static struct group tmp_grp; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getgrnam.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 /* Dummy function */ 8 8 9 struct group * _getgrnam (const char *name)9 struct group *getgrnam (const char *name) 10 10 { 11 11 static struct group tmp_grp; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getgroup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <sys/types.h> 5 5 6 int _getgroups (int gidsetsize, gid_t grouplist [])6 int getgroups (int gidsetsize, gid_t grouplist []) 7 7 { 8 8 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getlogin.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <unistd.h> 7 7 8 char * _getlogin (void)8 char *getlogin (void) 9 9 { 10 10 static char tmp_name[L_cuserid]; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getopt.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 34 34 /* Note: `argv' is not const as GETOPT_ANY reorders argv[]. */ 35 35 36 int _getopt (int argc, char * argv[], const char *opt_str)36 int getopt (int argc, char * argv[], const char *opt_str) 37 37 { 38 38 char c, *q; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpages.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <stdlib.h> 4 4 5 int _getpagesize (void)5 int getpagesize (void) 6 6 { 7 7 return 4096; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpass.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <unistd.h> 4 4 5 char * _getpass (const char *prompt)5 char *getpass (const char *prompt) 6 6 { 7 7 return _getpass2 (prompt, 1); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpgrp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <sys/types.h> 6 6 7 pid_t _getpgrp (void)7 pid_t getpgrp (void) 8 8 { 9 return _getpid ();9 return getpid (); 10 10 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpwnam.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 9 9 /* Dummy function */ 10 10 11 struct passwd * _getpwnam (const char *name)11 struct passwd *getpwnam (const char *name) 12 12 { 13 13 if (name == NULL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpwuid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 8 8 /* Dummy function */ 9 9 10 struct passwd * _getpwuid (uid_t uid)10 struct passwd *getpwuid (uid_t uid) 11 11 { 12 12 return _getpw (uid, NULL); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getuid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <sys/types.h> 5 5 6 uid_t _getuid (void)6 uid_t getuid (void) 7 7 { 8 8 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getvol.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 25 25 return NULL; 26 26 27 if (_osmode == OS2_MODE) 28 { 29 ULONG rc; 30 FSINFO fsinfo; 27 ULONG rc; 28 FSINFO fsinfo; 31 29 32 memset (&fsinfo, 0, sizeof (fsinfo)); 33 rc = DosQueryFSInfo (drive - 'A' + 1, FSIL_VOLSER, &fsinfo, 34 sizeof (fsinfo)); 35 if (rc != 0) 36 return NULL; 37 strcpy (result, fsinfo.vol.szVolLabel); 38 } 39 else 40 { 41 static struct _find find; 42 char mask[7]; 30 memset (&fsinfo, 0, sizeof (fsinfo)); 31 rc = DosQueryFSInfo (drive - 'A' + 1, FSIL_VOLSER, &fsinfo, 32 sizeof (fsinfo)); 33 if (rc != 0) 34 return NULL; 35 strcpy (result, fsinfo.vol.szVolLabel); 43 36 44 mask[0] = drive;45 strcpy (mask + 1, ":\\*.*");46 if (__findfirst (mask, _A_VOLID, &find) != 0)47 return NULL;48 strcpy (result, find.name);49 }50 37 return result; 51 38 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getwd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 char * _getwd (char *buffer)9 char *getwd (char *buffer) 10 10 { 11 11 if (buffer == NULL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/glob.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <errno.h> 6 6 #include <unistd.h> 7 #include <fnmatch.h> 7 #include <alloca.h> 8 #include <emx/fnmatch.h> 8 9 #include <glob.h> 9 10 #include <sys/types.h> … … 115 116 /* TODO: Optimize for lpat not containing global characters. */ 116 117 117 dir = _opendir (*base != 0 ? base : ".");118 dir = opendir (*base != 0 ? base : "."); 118 119 if (dir == NULL) 119 120 { … … 124 125 return 0; 125 126 } 126 while ((ent = _readdir (dir)) != NULL)127 { 128 if ( _fnmatch (lpat, ent->d_name, fnm_flags) == 0)127 while ((ent = readdir (dir)) != NULL) 128 { 129 if (fnmatch (lpat, ent->d_name, fnm_flags) == 0) 129 130 { 130 131 len = base_len + ent->d_namlen; … … 145 146 if (!glob_add (pg, path)) 146 147 { 147 _closedir (dir);148 closedir (dir); 148 149 return GLOB_NOSPACE; 149 150 } … … 158 159 if (r != 0) 159 160 { 160 _closedir (dir);161 closedir (dir); 161 162 return r; 162 163 } … … 164 165 } 165 166 } 166 _closedir (dir);167 closedir (dir); 167 168 return 0; 168 169 } … … 175 176 176 177 177 int _glob (const char *pattern, int flags,178 178 int glob (const char *pattern, int flags, 179 int (*errfun)(const char *e_path, int e_errno), glob_t *pglob) 179 180 { 180 181 struct globi g; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/mkdir.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/syscalls.h> 6 6 7 int _mkdir (const char *name, long mode)7 int mkdir (const char *name, long mode) 8 8 { 9 mode = 0; /* Keep the compiler happy */9 (void)mode; /* Keep the compiler happy */ 10 10 if (__mkdir (name) == 0) 11 11 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/os2bad.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 9 9 { 10 10 __write (2, msg, sizeof (msg) - 1); 11 _exit (2);11 exit (2); 12 12 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/pathconf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 /* Return the POSIX.1 minimum values, for now. */ 8 8 9 long _pathconf (const char *path, int name)9 long pathconf (const char *path, int name) 10 10 { 11 11 switch (name) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/perror.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 14 14 } 15 15 if (e >= 0 && e < _sys_nerr) 16 fputs ( _sys_errlist[e], stderr);16 fputs (sys_errlist[e], stderr); 17 17 else 18 18 fprintf (stderr, "Unknown error %d", e); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/pwd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 58 58 59 59 60 struct passwd * _getpwent (void)60 struct passwd *getpwent (void) 61 61 { 62 62 return NULL; /* End of /etc/passwd reached */ … … 64 64 65 65 66 void _setpwent (void)66 void setpwent (void) 67 67 { 68 68 } 69 69 70 70 71 void _endpwent (void)71 void endpwent (void) 72 72 { 73 73 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/rmdir.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <emx/syscalls.h> 6 6 7 int _rmdir (const char *name)7 int rmdir (const char *name) 8 8 { 9 9 if (__rmdir (name) == 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/sbrk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 void * _sbrk (int incr)6 void *sbrk (int incr) 7 7 { 8 8 return __sbrk (incr); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/scrsize.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <emx/syscalls.h> 4 4 5 void _scrsize (int *dst)5 void scrsize (int *dst) 6 6 { 7 7 __scrsize (dst); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/searchen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 12 12 13 13 strcpy (path, file); 14 if ( _access (path, 4) == 0)14 if (access (path, 4) == 0) 15 15 return; 16 16 list = getenv (var); … … 30 30 path[i++] = '\\'; 31 31 strcpy (path+i, file); 32 if ( _access (path, 4) == 0)32 if (access (path, 4) == 0) 33 33 return; 34 34 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/setgid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <sys/types.h> 6 6 7 int _setgid (gid_t gid)7 int setgid (gid_t gid) 8 8 { 9 9 if (gid != 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/setpgid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <sys/types.h> 6 6 7 int _setpgid (pid_t pid, pid_t pgid)7 int setpgid (pid_t pid, pid_t pgid) 8 8 { 9 9 errno = ENOSYS; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/setsid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <sys/types.h> 6 6 7 pid_t _setsid (void)7 pid_t setsid (void) 8 8 { 9 9 errno = EPERM; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/setuid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <sys/types.h> 6 6 7 int _setuid (uid_t uid)7 int setuid (uid_t uid) 8 8 { 9 9 if (uid != 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/sleep.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 unsigned _sleep (unsigned sec)6 unsigned sleep (unsigned sec) 7 7 { 8 8 return __sleep (sec); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/sleep2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 unsigned _sleep2 (unsigned millisec)6 unsigned sleep2 (unsigned millisec) 7 7 { 8 8 return __sleep2 (millisec); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/sysconf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 8 8 /* Return the POSIX.1 minimum values, for now. */ 9 9 10 long _sysconf (int name)10 long sysconf (int name) 11 11 { 12 12 switch (name) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/syserr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 1 /* syserr.c (emx+gcc) -- Copyright (c) 1990-1998 by Eberhard Mattes */ 2 2 3 const char * const _sys_errlist[] =3 const char * const sys_errlist[] = 4 4 { 5 5 /* 0 EZERO */ "Error 0", … … 72 72 }; 73 73 74 const int _sys_nerr = sizeof (_sys_errlist) / sizeof (_sys_errlist[0]);74 const int sys_nerr = sizeof (sys_errlist) / sizeof (sys_errlist[0]); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/syserrno.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <emx/syscalls.h> 4 4 5 int _syserrno (void)5 int syserrno (void) 6 6 { 7 7 return __syserrno (); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/uflags.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 6 int _uflags (int mask, int new_bits)6 int uflags (int mask, int new_bits) 7 7 { 8 8 return __uflags (mask, new_bits); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/ulimit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 long _ulimit (int cmd, ...)9 long ulimit (int cmd, ...) 10 10 { 11 11 va_list arg_ptr; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/uname.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 9 9 #define CHR(x) (char)((x)+'0') 10 10 11 int _uname (struct utsname *name)11 int uname (struct utsname *name) 12 12 { 13 13 char *host; 14 int dos;15 14 16 dos = (_osmode == DOS_MODE && _osmajor < 10);17 15 host = getenv ("HOSTNAME"); 18 16 if (host == NULL) 19 17 host = "standalone"; 20 18 21 SET (sysname, ( dos ? "MS-DOS" :"OS/2"));19 SET (sysname, ("OS/2")); 22 20 SET (nodename, host); 23 21 SET (release, "1"); 24 name->version[0] = ( dos ? CHR (_osmajor) :CHR (_osmajor / 10));22 name->version[0] = (CHR (_osmajor / 10)); 25 23 name->version[1] = '.'; 26 24 name->version[2] = CHR (_osminor / 10); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/moddef/moddef.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := A library for working with .DEF files 3 3 4 .TKIND := aout st4 .TKIND := aout 5 5 .TARGET := moddef$A 6 6 .TSRC := $(wildcard src/lib/moddef/*.c) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/omflib/omflib.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := A library for reading/writing OMF object files 3 3 4 .TKIND := aout st4 .TKIND := aout 5 5 .TARGET := omflib$A 6 6 .TSRC := $(wildcard src/lib/omflib/*.c) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/386/_errno.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 14 14 __errno: 15 15 __errno_fun: 16 cmpb $0, __osmode /* _osmode == DOS_MODE? */17 je 1f /* Yes -> */18 16 fs 19 17 movl 12, %eax /* ptib2 */ … … 21 19 movl __thread_tab(,%eax,4), %eax 22 20 / addl $0, %eax /* address of errno */ 23 Lreturn:EPILOGUE(_errno) 24 25 ALIGN 26 27 1: movl __thread_tab+4, %eax 28 / addl $0, %eax /* address of errno */ 29 jmp Lreturn 21 EPILOGUE(_errno) 30 22 31 23 #else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/386/gettid.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 10 10 11 11 __gettid: 12 cmpb $0, __osmode /* _osmode == DOS_MODE? */13 je 1f /* Yes -> */14 12 fs 15 13 movl 12, %eax /* ptib2 */ 16 14 movl 0(%eax), %eax /* TID */ 17 Lreturn:EPILOGUE(_gettid) 18 19 ALIGN 20 1: movl $1, %eax 21 jmp Lreturn 15 EPILOGUE(_gettid) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/386/thread.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 12 12 13 13 __thread: 14 cmpb $0, __osmode /* _osmode == DOS_MODE? */15 je 1f /* Yes -> */16 14 fs 17 15 movl 12, %eax /* ptib2 */ … … 19 17 movl __thread_tab(,%edx,4), %eax 20 18 testl %eax, %eax 21 jz 2f19 jz 1f 22 20 Lreturn:EPILOGUE(_thread) 23 21 24 22 ALIGN 25 1: movl __thread_tab+4, %eax 26 jmp Lreturn 27 28 ALIGN 29 2: pushl %edx 23 1: pushl %edx 30 24 call ___alloc_thread 31 25 popl %edx -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execl.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _execl (const char *name, const char *arg0, ...)7 int execl (const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 14 14 /* Note: Passing `arg_ptr' to spawnv() is not portable. */ 15 15 16 result = _spawnv (P_OVERLAY, name, (char * const *)arg_ptr);16 result = spawnv (P_OVERLAY, name, (char * const *)arg_ptr); 17 17 va_end (arg_ptr); 18 18 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execle.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _execle (const char *name, const char *arg0, ...)7 int execle (const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 20 20 /* Note: Passing `arg_ptr' to spawnve() is not portable. */ 21 21 22 result = _spawnve (P_OVERLAY, name, (char * const *)arg_ptr, env_ptr);22 result = spawnve (P_OVERLAY, name, (char * const *)arg_ptr, env_ptr); 23 23 va_end (arg_ptr); 24 24 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execlp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _execlp (const char *name, const char *arg0, ...)7 int execlp (const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 14 14 /* Note: Passing `arg_ptr' to spawnvp() is not portable. */ 15 15 16 result = _spawnvp (P_OVERLAY, name, (char * const *)arg_ptr);16 result = spawnvp (P_OVERLAY, name, (char * const *)arg_ptr); 17 17 va_end (arg_ptr); 18 18 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execlpe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _execlpe (const char *name, const char *arg0, ...)7 int execlpe (const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 20 20 /* Note: Passing `arg_ptr' to spawnvpe() is not portable. */ 21 21 22 result = _spawnvpe (P_OVERLAY, name, (char * const *)arg_ptr, env_ptr);22 result = spawnvpe (P_OVERLAY, name, (char * const *)arg_ptr, env_ptr); 23 23 va_end (arg_ptr); 24 24 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execv.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <process.h> 4 4 5 int _execv (const char *name, char * const argv[])5 int execv (const char *name, char * const argv[]) 6 6 { 7 return _spawnv (P_OVERLAY, name, argv);7 return spawnv (P_OVERLAY, name, argv); 8 8 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execve.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <process.h> 4 4 5 int _execve (const char *name, char * const argv[], char * const envp[])5 int execve (const char *name, char * const argv[], char * const envp[]) 6 6 { 7 return _spawnve (P_OVERLAY, name, argv, envp);7 return spawnve (P_OVERLAY, name, argv, envp); 8 8 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execvp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <process.h> 4 4 5 int _execvp (const char *name, char * const argv[])5 int execvp (const char *name, char * const argv[]) 6 6 { 7 return _spawnvp (P_OVERLAY, name, argv);7 return spawnvp (P_OVERLAY, name, argv); 8 8 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execvpe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <process.h> 4 4 5 int _execvpe (const char *name, char * const argv[], char * const envp[])5 int execvpe (const char *name, char * const argv[], char * const envp[]) 6 6 { 7 return _spawnvpe (P_OVERLAY, name, argv, envp);7 return spawnvpe (P_OVERLAY, name, argv, envp); 8 8 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fmutex.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 16 16 { 17 17 sem->fs = _FMS_AVAILABLE; 18 if (_osmode == DOS_MODE)19 return 0;20 18 return DosCreateEventSem (NULL, (PHEV)&sem->hev, 21 19 (flags & _FMC_SHARED) ? DC_SEM_SHARED : 0, … … 26 24 unsigned _fmutex_open (_fmutex *sem) 27 25 { 28 if (_osmode == DOS_MODE)29 return 0;30 26 return DosOpenEventSem (NULL, (PHEV)&sem->hev); 31 27 } … … 34 30 unsigned _fmutex_close (_fmutex *sem) 35 31 { 36 if (_osmode == DOS_MODE)37 return 0;38 32 return DosCloseEventSem (sem->hev); 39 33 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fork.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 extern void _rmutex_fork (void); 7 7 8 int _fork (void)8 int fork (void) 9 9 { 10 10 int pid; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnl.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _spawnl (int mode, const char *name, const char *arg0, ...)7 int spawnl (int mode, const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 14 14 /* Note: Passing `arg_ptr' to spawnv() is not portable. */ 15 15 16 result = _spawnv (mode, name, (char * const *)arg_ptr);16 result = spawnv (mode, name, (char * const *)arg_ptr); 17 17 va_end (arg_ptr); 18 18 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnle.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _spawnle (int mode, const char *name, const char *arg0, ...)7 int spawnle (int mode, const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 20 20 /* Note: Passing `arg_ptr' to spawnve() is not portable. */ 21 21 22 result = _spawnve (mode, name, (char * const *)arg_ptr, env_ptr);22 result = spawnve (mode, name, (char * const *)arg_ptr, env_ptr); 23 23 va_end (arg_ptr); 24 24 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnlp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _spawnlp (int mode, const char *name, const char *arg0, ...)7 int spawnlp (int mode, const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 14 14 /* Note: Passing `arg_ptr' to spawnvp() is not portable. */ 15 15 16 result = _spawnvp (mode, name, (char * const *)arg_ptr);16 result = spawnvp (mode, name, (char * const *)arg_ptr); 17 17 va_end (arg_ptr); 18 18 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnlpe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 5 5 #include <process.h> 6 6 7 int _spawnlpe (int mode, const char *name, const char *arg0, ...)7 int spawnlpe (int mode, const char *name, const char *arg0, ...) 8 8 { 9 9 va_list arg_ptr; … … 20 20 /* Note: Passing `arg_ptr' to spawnvpe() is not portable. */ 21 21 22 result = _spawnvpe (mode, name, (char * const *)arg_ptr, env_ptr);22 result = spawnvpe (mode, name, (char * const *)arg_ptr, env_ptr); 23 23 va_end (arg_ptr); 24 24 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnv.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <process.h> 5 5 6 int _spawnv (int mode, const char *name, char * const argv[])6 int spawnv (int mode, const char *name, char * const argv[]) 7 7 { 8 return _spawnve (mode, name, argv, NULL);8 return spawnve (mode, name, argv, NULL); 9 9 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnvp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <process.h> 5 5 6 int _spawnvp (int mode, const char *name, char * const argv[])6 int spawnvp (int mode, const char *name, char * const argv[]) 7 7 { 8 return _spawnvpe (mode, name, argv, NULL);8 return spawnvpe (mode, name, argv, NULL); 9 9 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/spawnvpe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 3 3 #include <stdlib.h> 4 #include <string.h> 4 5 #include <process.h> 5 6 #include <errno.h> 6 7 7 int _spawnvpe (int mode, const char *name, char * const argv[],8 8 int spawnvpe (int mode, const char *name, char * const argv[], 9 char * const envp[]) 9 10 { 10 11 char exe[512]; … … 20 21 if (_path (path, exe) != 0) 21 22 return -1; 22 return _spawnve (mode, path, argv, envp);23 return spawnve (mode, path, argv, envp); 23 24 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/system.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 23 23 return _access (sh, 0) == 0; 24 24 if (*name == 0) 25 rc = _spawnlp (P_WAIT, sh, sh, (char *)0);25 rc = spawnlp (P_WAIT, sh, sh, (char *)0); 26 26 else 27 27 { 28 28 base = _getname (sh); 29 if (_stricmp (base, "cmd.exe") == 0 || _stricmp (base, "4os2.exe") == 0 30 || _stricmp (base, "command.com") == 0 31 || _stricmp (base, "4dos.com") == 0) 29 if (stricmp (base, "cmd.exe") == 0 30 || stricmp (base, "4os2.exe") == 0 31 || stricmp (base, "command.com") == 0 32 || stricmp (base, "4dos.com") == 0) 32 33 opt = "/c"; 33 34 else 34 35 opt = "-c"; 35 rc = _spawnlp (P_WAIT, sh, sh, opt, name, (char *)0);36 rc = spawnlp (P_WAIT, sh, sh, opt, name, (char *)0); 36 37 } 37 38 return rc; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/crt0.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 13 13 __text: 14 14 push $__data 15 #if defined (OMF)16 15 call __emx_init 17 #else18 call __dos_init19 #endif20 16 jmp __init 21 17 22 18 ___syscall: 23 #if defined (OMF)24 19 call __emx_syscall 25 #else26 call __dos_syscall27 #endif28 20 ret 29 21 … … 55 47 56 48 __data: 57 #if defined (OMF)58 .long 059 .long 060 .long 061 .long 062 .long 063 .long 064 #else65 .long __text66 .long __etext67 .long __data68 .long __edata69 .long __edata70 .long __end71 #endif72 49 __heap_base: 73 50 .long 0 /* heap base address */ … … 80 57 .long 0 /* stack base address */ 81 58 .long 0 /* stack end address */ 82 #if defined (OMF)83 59 .long 0x02000002 /* flags: application, OMF */ 84 #else85 .long 0x02000000 /* flags: application */86 #endif87 60 .long 0 /* reserved */ 88 61 .long 0 /* reserved */ … … 92 65 / first element of vector (N_SETA|N_EXT == 21) 93 66 94 #if defined (OMF)95 67 __os2dll: 96 68 .long 0, 0 97 #else 98 .stabs "__os2dll", 21, 0, 0, 0xffffffff 99 #endif 69 / .stabs "__os2dll", 21, 0, 0, 0xffffffff 100 70 101 71 .stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/crt1.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 14 14 .globl _errno 15 15 #endif 16 .globl __osmode17 16 .globl __emx_env 18 17 .globl __emx_vcmp … … 37 36 movl %eax, __emx_vprt 38 37 movb $0, __emx_vprt+4 39 testl $0x200, %edx40 setne __osmode41 38 EPILOGUE(_entry2) 42 39 … … 46 43 _errno: .long 0 47 44 #endif 48 __osmode: .byte 1 /* OS2_MODE = 1 */49 45 .comm __emx_rev, 4 50 46 .comm __emx_env, 4 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/dll0.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 13 13 __text: 14 14 push $__data 15 #if defined (OMF)16 15 call __emx_init 17 #else18 call __dos_init19 #endif20 16 jmp __init 21 17 22 18 23 19 ___syscall: 24 #if defined (OMF)25 20 call __emx_syscall 26 #else27 call __dos_syscall28 #endif29 21 ret 30 22 … … 61 53 .long 0 /* stack base address */ 62 54 .long 0 /* stack end address */ 63 #if defined (OMF)64 55 .long 0x02000003 /* flags: DLL, OMF */ 65 #else66 .long 0x02000001 /* flags: DLL */67 #endif68 56 .long 0 /* reserved */ 69 57 .long 0 /* reserved */ … … 73 61 / first element of vector (N_SETA|N_EXT == 21) 74 62 75 #if defined (OMF)76 63 __os2dll: 77 64 .long 0, 0 78 #else 79 .stabs "__os2dll", 21, 0, 0, 0xffffffff 80 #endif 65 / .stabs "__os2dll", 21, 0, 0, 0xffffffff 81 66 82 67 .stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/gmon.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 32 32 */ 33 33 34 #ifndef lint35 static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91";36 #endif /* not lint */37 38 #if 039 #include <unistd.h>40 41 #endif42 #ifdef DEBUG43 34 #include <stdio.h> 44 #endif45 46 #ifdef EMX47 35 #include <stdlib.h> 48 36 #include <fcntl.h> 49 #endif /* EMX */ 37 #include <unistd.h> 38 #include <io.h> 50 39 51 40 #include "gmon.h" 52 41 53 #ifndef EMX 54 extern mcount() asm ("mcount"); 55 extern char *minbrk asm ("minbrk"); 56 #endif /* not EMX */ 57 58 /* 59 * froms is actually a bunch of unsigned shorts indexing tos 60 */ 42 /* 43 * froms is actually a bunch of unsigned shorts indexing tos 44 */ 61 45 static int profiling = 3; 62 46 static unsigned short *froms; … … 70 54 static char *sbuf; 71 55 static int s_scale; 72 56 /* see profil(2) where this is describe (incorrectly) */ 73 57 #define SCALE_1_TO_1 0x10000L 74 58 75 59 #define MSG "No space for profiling buffer(s)\n" 76 60 61 /* Forward definition */ 62 void moncontrol(); 63 64 void 77 65 monstartup(lowpc, highpc) 78 66 char *lowpc; … … 119 107 return; 120 108 } 121 #ifndef EMX122 minbrk = sbrk(0);123 #endif /* not EMX */124 109 tos[0].link = 0; 125 110 sbuf = buffer; … … 133 118 o = highpc - lowpc; 134 119 if( monsize < o ) 135 #ifndef hp300136 120 s_scale = ( (float) monsize / o ) * SCALE_1_TO_1; 137 #else /* avoid floating point */138 {139 int quot = o / monsize;140 141 if (quot >= 0x10000)142 s_scale = 1;143 else if (quot >= 0x100)144 s_scale = 0x10000 / quot;145 else if (o >= 0x800000)146 s_scale = 0x1000000 / (o / (monsize >> 8));147 else148 s_scale = 0x1000000 / ((o << 8) / monsize);149 }150 #endif151 121 else 152 122 s_scale = SCALE_1_TO_1; … … 154 124 } 155 125 126 void 156 127 _mcleanup() 157 128 { … … 164 135 165 136 moncontrol(0); 166 fd = creat( "gmon.out" , 0666);167 if ( fd < 0) {137 fd = open ("gmon.out" , O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666); 138 if (fd < 0) { 168 139 perror( "mcount: gmon.out" ); 169 140 return; 170 141 } 171 #ifdef EMX172 setmode (fd, O_BINARY);173 #endif /* EMX */174 142 # ifdef DEBUG 175 143 fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); 176 # endif DEBUG144 # endif /* DEBUG */ 177 145 write( fd , sbuf , ssiz ); 178 146 endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); … … 187 155 "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , 188 156 frompc , tos[toindex].selfpc , tos[toindex].count ); 189 # endif DEBUG157 # endif /* DEBUG */ 190 158 rawarc.raw_frompc = (unsigned long) frompc; 191 159 rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; … … 197 165 } 198 166 199 #ifdef EMX 167 void 200 168 _mcount() 201 #else /* not EMX */202 mcount()203 #endif /* not EMX */204 169 { 205 register char *selfpc; 206 register unsigned short *frompcindex; 207 register struct tostruct *top; 208 register struct tostruct *prevtop; 209 register long toindex; 210 170 register char *selfpc; 171 register unsigned short *frompcindex; 172 register struct tostruct *top; 173 register struct tostruct *prevtop; 174 register long toindex; 175 176 /* 177 * find the return address for mcount, 178 * and the return address for mcount's caller. 179 */ 180 181 /* selfpc = pc pushed by mcount call. 182 This identifies the function that was just entered. */ 183 selfpc = (void *) __builtin_return_address (0); 184 /* frompcindex = pc in preceding frame. 185 This identifies the caller of the function just entered. */ 186 frompcindex = (void *) __builtin_return_address (1); 187 /* 188 * check that we are profiling 189 * and that we aren't recursively invoked. 190 */ 191 if (profiling) { 192 goto out; 193 } 194 195 /* Profile thread 1 only. */ 196 if (_gettid () != 1) 197 goto out; 198 199 profiling++; 200 /* 201 * check that frompcindex is a reasonable pc value. 202 * for example: signal catchers get called from the stack, 203 * not from text space. too bad. 204 */ 205 frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc); 206 if ((unsigned long)frompcindex > s_textsize) { 207 goto done; 208 } 209 frompcindex = 210 &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))]; 211 toindex = *frompcindex; 212 if (toindex == 0) { 211 213 /* 212 * find the return address for mcount, 213 * and the return address for mcount's caller. 214 * first time traversing this arc 214 215 */ 215 216 /* selfpc = pc pushed by mcount call. 217 This identifies the function that was just entered. */ 218 selfpc = (void *) __builtin_return_address (0); 219 /* frompcindex = pc in preceding frame. 220 This identifies the caller of the function just entered. */ 221 frompcindex = (void *) __builtin_return_address (1); 216 toindex = ++tos[0].link; 217 if (toindex >= tolimit) { 218 goto overflow; 219 } 220 *frompcindex = toindex; 221 top = &tos[toindex]; 222 top->selfpc = selfpc; 223 top->count = 1; 224 top->link = 0; 225 goto done; 226 } 227 top = &tos[toindex]; 228 if (top->selfpc == selfpc) { 222 229 /* 223 * check that we are profiling 224 * and that we aren't recursively invoked. 230 * arc at front of chain; usual case. 225 231 */ 226 if (profiling) { 227 goto out; 228 } 229 #ifdef EMX 230 /* Profile thread 1 only. */ 231 if (_gettid () != 1) 232 goto out; 233 #endif /* EMX */ 234 profiling++; 232 top->count++; 233 goto done; 234 } 235 /* 236 * have to go looking down chain for it. 237 * top points to what we are looking at, 238 * prevtop points to previous top. 239 * we know it is not at the head of the chain. 240 */ 241 for (; /* goto done */; ) { 242 if (top->link == 0) { 243 /* 244 * top is end of the chain and none of the chain 245 * had top->selfpc == selfpc. 246 * so we allocate a new tostruct 247 * and link it to the head of the chain. 248 */ 249 toindex = ++tos[0].link; 250 if (toindex >= tolimit) { 251 goto overflow; 252 } 253 top = &tos[toindex]; 254 top->selfpc = selfpc; 255 top->count = 1; 256 top->link = *frompcindex; 257 *frompcindex = toindex; 258 goto done; 259 } 235 260 /* 236 * check that frompcindex is a reasonable pc value. 237 * for example: signal catchers get called from the stack, 238 * not from text space. too bad. 261 * otherwise, check the next arc on the chain. 239 262 */ 240 frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc); 241 if ((unsigned long)frompcindex > s_textsize) { 242 goto done; 243 } 244 frompcindex = 245 &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))]; 246 toindex = *frompcindex; 247 if (toindex == 0) { 248 /* 249 * first time traversing this arc 250 */ 251 toindex = ++tos[0].link; 252 if (toindex >= tolimit) { 253 goto overflow; 254 } 255 *frompcindex = toindex; 256 top = &tos[toindex]; 257 top->selfpc = selfpc; 258 top->count = 1; 259 top->link = 0; 260 goto done; 261 } 262 top = &tos[toindex]; 263 prevtop = top; 264 top = &tos[top->link]; 263 265 if (top->selfpc == selfpc) { 264 /* 265 * arc at front of chain; usual case. 266 */ 267 top->count++; 268 goto done; 269 } 270 /* 271 * have to go looking down chain for it. 272 * top points to what we are looking at, 273 * prevtop points to previous top. 274 * we know it is not at the head of the chain. 275 */ 276 for (; /* goto done */; ) { 277 if (top->link == 0) { 278 /* 279 * top is end of the chain and none of the chain 280 * had top->selfpc == selfpc. 281 * so we allocate a new tostruct 282 * and link it to the head of the chain. 283 */ 284 toindex = ++tos[0].link; 285 if (toindex >= tolimit) { 286 goto overflow; 287 } 288 top = &tos[toindex]; 289 top->selfpc = selfpc; 290 top->count = 1; 291 top->link = *frompcindex; 292 *frompcindex = toindex; 293 goto done; 294 } 295 /* 296 * otherwise, check the next arc on the chain. 297 */ 298 prevtop = top; 299 top = &tos[top->link]; 300 if (top->selfpc == selfpc) { 301 /* 302 * there it is. 303 * increment its count 304 * move it to the head of the chain. 305 */ 306 top->count++; 307 toindex = prevtop->link; 308 prevtop->link = top->link; 309 top->link = *frompcindex; 310 *frompcindex = toindex; 311 goto done; 312 } 313 314 } 266 /* 267 * there it is. 268 * increment its count 269 * move it to the head of the chain. 270 */ 271 top->count++; 272 toindex = prevtop->link; 273 prevtop->link = top->link; 274 top->link = *frompcindex; 275 *frompcindex = toindex; 276 goto done; 277 } 278 } 315 279 done: 316 317 280 profiling--; 281 /* and fall through */ 318 282 out: 319 283 return; /* normal return restores saved registers */ 320 284 321 285 overflow: 322 323 # define TOLIMIT"mcount: tos overflow\n"324 325 286 profiling++; /* halt further profiling */ 287 #define TOLIMIT "mcount: tos overflow\n" 288 write(2, TOLIMIT, sizeof(TOLIMIT)); 289 goto out; 326 290 } 327 291 … … 331 295 * all the data structures are ready. 332 296 */ 297 void 333 298 moncontrol(mode) 334 299 int mode; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/memccpy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <string.h> 4 4 5 void * _memccpy (void *s1, const void *s2, int c, size_t n)5 void *memccpy (void *s1, const void *s2, int c, size_t n) 6 6 { 7 7 size_t i; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/memicmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <ctype.h> 5 5 6 int _memicmp (const void *s1, const void *s2, size_t n)6 int memicmp (const void *s1, const void *s2, size_t n) 7 7 { 8 8 size_t i; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strdup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <stdlib.h> 5 5 6 char * _strdup (const char *string)6 char *strdup (const char *string) 7 7 { 8 8 char *p; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strerror.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 19 19 #endif 20 20 memcpy (result, msg, sizeof (msg) - 1); 21 _itoa (errnum, result + sizeof (msg) - 1, 10);21 itoa (errnum, result + sizeof (msg) - 1, 10); 22 22 return result; 23 23 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/stricmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <ctype.h> 5 5 6 int _stricmp (const char *string1, const char *string2)6 int stricmp (const char *string1, const char *string2) 7 7 { 8 8 int d; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strlwr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <ctype.h> 5 5 6 char * _strlwr (char *string)6 char *strlwr (char *string) 7 7 { 8 8 unsigned char *p; … … 10 10 for (p = (unsigned char *)string; *p != 0; ++p) 11 11 if (isupper (*p)) 12 *p = (unsigned char) _tolower (*p);12 *p = (unsigned char)tolower (*p); 13 13 return string; 14 14 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strnicmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <ctype.h> 5 5 6 int _strnicmp (const char *string1, const char *string2, size_t count)6 int strnicmp (const char *string1, const char *string2, size_t count) 7 7 { 8 8 int d; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strnset.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <string.h> 4 4 5 char * _strnset (char *string, int c, size_t count)5 char *strnset (char *string, int c, size_t count) 6 6 { 7 7 char *dst; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strrev.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <string.h> 4 4 5 char * _strrev (char *string)5 char *strrev (char *string) 6 6 { 7 7 char *p, *q, c; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strset.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 #include <string.h> 4 4 5 char * _strset (char *string, int c)5 char *strset (char *string, int c) 6 6 { 7 7 char *dst; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strtok.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 12 12 #define next (tp->_th_strtok_ptr) 13 13 #else 14 14 static unsigned char *next = NULL; 15 15 #endif 16 16 if (string1 != NULL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strupr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <ctype.h> 5 5 6 char * _strupr (char *string)6 char *strupr (char *string) 7 7 { 8 8 unsigned char *p; … … 10 10 for (p = (unsigned char *)string; *p != 0; ++p) 11 11 if (islower (*p)) 12 *p = (unsigned char) _toupper (*p);12 *p = (unsigned char)toupper (*p); 13 13 return string; 14 14 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ftime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 21 21 tm.tm_year = now.year - 1900; 22 22 tm.tm_isdst = -1; /* unknown */ 23 ptr->time = (time_t) _mktime (&tm);23 ptr->time = (time_t)mktime (&tm); 24 24 ptr->millitm = now.hundredths * 10; 25 25 ptr->timezone = now.timezone; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__getdrive.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 19 19 } 20 20 } 21 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__init.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <os2emx.h> 5 5 #include <string.h> 6 #include <alloca.h> 6 7 #include <sys/builtin.h> 7 8 #include <sys/fmutex.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__mkdir.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 #include "syscalls.h" 6 7 6 8 7 int __mkdir (const char *name) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__rmdir.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <emx/syscalls.h> 5 5 #include "syscalls.h" 6 7 6 8 7 int __rmdir (const char *name) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filesys.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <errno.h> 5 5 #include <os2emx.h> 6 #include <alloca.h> 6 7 #include <emx/syscalls.h> 7 8 #include "syscalls.h" -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/p2t.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 18 18 tm.tm_year = d.year + 1980 - 1900; 19 19 tm.tm_isdst = -1; /* unknown */ 20 return _mktime (&tm);20 return mktime (&tm); 21 21 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/pause.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 4 4 #include <os2emx.h> 5 5 #include <emx/syscalls.h> 6 #include <errno.h> 6 7 #include "syscalls.h" 7 8 8 void __pause (void)9 int pause (void) 9 10 { 10 11 while (DosSleep (0xffffffff) == 0) 11 12 ; 13 errno = EINTR; 14 return -1; 12 15 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sigaction.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 #include "syscalls.h" 8 9 8 10 9 int __sigaction (int signo, const struct sigaction *iact, -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/spawnve.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 1 /* s ys/spawnve.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */1 /* spawnve.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 3 #include <stdlib.h> … … 5 5 #include <process.h> 6 6 #include <errno.h> 7 # define INCL_DOSPROCESS8 #include < os2emx.h>7 #include <alloca.h> 8 #include <emx/startup.h> 9 9 #include <emx/syscalls.h> 10 #include "syscalls.h"11 10 12 /* Note: We are allowed to call _trealloc() as this module is not used 13 in an .a library. */ 11 int spawnve (int mode, const char *name, char * const argv[], 12 char * const envp[]) 13 { 14 struct _new_proc np; 15 int i, size, n; 16 const char * const *p; 17 char *d; 18 char exe[512]; 14 19 15 #define ADD(n) do { \ 16 while (arg_size + n > arg_alloc) \ 17 { \ 18 arg_alloc += 512; \ 19 arg_buf = _trealloc (arg_buf, arg_alloc); \ 20 if (arg_buf == NULL) \ 21 { \ 22 errno = ENOMEM; \ 23 return -1; \ 24 } \ 25 arg_ptr = arg_buf + arg_size; \ 26 } \ 27 arg_size += n; } while (0) 20 /* Kludge alert: Unfortunately, the `mode' member was made only 16 21 bits wide originally. Bit 15 is used to indicate that the 22 `mode2' member is used, which holds the upper 16 bits of MODE. 23 This allows using emx 0.8 applications with emx 0.9 as emx 24 doesn't look at `mode2' unless bit 15 of `mode' is set. Of 25 course, this fails if an (old) application program sets bit 15 of 26 MODE. */ 28 27 28 np.mode = (unsigned short)(mode | 0x8000); 29 np.mode2 = (unsigned short)((unsigned)mode >> 16); 29 30 30 int __spawnve (struct _new_proc *np) 31 { 32 ULONG rc; 33 ULONG exec_flag, mode; 34 RESULTCODES res; 35 char obj[40], *arg_ptr, *arg_buf; 36 char *pgm_name, *base; 37 const char *src, *s; 38 size_t arg_size, arg_alloc, len; 39 int i, quote, bs, method; 40 41 arg_buf = NULL; arg_alloc = 0; arg_size = 0; arg_ptr = NULL; 42 43 mode = np->mode; 44 if (np->mode & 0x8000) 45 mode |= np->mode2 << 16; 46 47 switch (mode & 0xff) 31 if (envp == NULL) envp = _environ; 32 if (strlen (name) >= sizeof (exe) - 4) 48 33 { 49 case P_WAIT: 50 exec_flag = EXEC_SYNC; 51 break; 52 case P_NOWAIT: 53 exec_flag = EXEC_ASYNCRESULT; 54 break; 55 case P_OVERLAY: 56 exec_flag = EXEC_ASYNC; 57 break; 58 default: 59 errno = EINVAL; 34 errno = ENAMETOOLONG; 60 35 return -1; 61 36 } 62 pgm_name = alloca (strlen ((const char *)np->fname_off) + 5); 63 strcpy (pgm_name, (const char *)np->fname_off); 64 _defext (pgm_name, "exe"); 65 base = _getname (pgm_name); 66 method = 0; 67 if (stricmp (base, "cmd.exe") == 0 || stricmp (base, "4os2.exe") == 0) 68 method = 1; 69 src = (const char *)np->arg_off; 70 if (np->arg_count > 0) 37 strcpy (exe, name); 38 _defext (exe, "exe"); 39 np.fname_off = (unsigned long)exe; 40 size = 1; n = 0; 41 for (p = (const char * const *)envp; *p != NULL; ++p) 71 42 { 72 ++src; /* skip flags byte */ 73 len = strlen (src) + 1; 74 ADD (len); 75 memcpy (arg_ptr, src, len); 76 arg_ptr += len; src += len; 43 ++n; size += 1 + strlen (*p); 77 44 } 78 for (i = 1; i < np->arg_count; ++i) 45 d = alloca (size); 46 np.env_count = n; np.env_size = size; 47 np.env_off = (unsigned long)d; 48 for (p = (const char * const *)envp; *p != NULL; ++p) 79 49 { 80 if (i > 1) 81 { 82 ADD (1); 83 *arg_ptr++ = ' '; 84 } 85 ++src; /* skip flags byte */ 86 quote = FALSE; 87 if (*src == 0) 88 quote = TRUE; 89 else if (mode & P_QUOTE) 90 { 91 if (src[0] == '@' && src[1] != 0) 92 quote = TRUE; 93 else 94 for (s = src; *s != 0; ++s) 95 if (*s == '?' || *s == '*') 96 { 97 quote = TRUE; 98 break; 99 } 100 } 101 if (!quote) 102 for (s = src; *s != 0; ++s) 103 if (*s == ' ' || *s == '\t' || (*s == '"' && method == 1)) 104 { 105 quote = TRUE; 106 break; 107 } 108 if (quote) 109 { 110 ADD (1); 111 *arg_ptr++ = '"'; 112 } 113 bs = 0; 114 while (*src != 0) 115 { 116 if (*src == '"' && method == 0) 117 { 118 ++bs; 119 ADD (bs); 120 memset (arg_ptr, '\\', bs); arg_ptr += bs; 121 bs = 0; 122 } 123 else if (*src == '\\' && method == 0) 124 ++bs; 125 else 126 bs = 0; 127 ADD (1); 128 *arg_ptr++ = *src; 129 ++src; 130 } 131 if (quote) 132 { 133 ADD (1+bs); 134 memset (arg_ptr, '\\', bs); arg_ptr += bs; 135 *arg_ptr++ = '"'; 136 } 137 ++src; 50 i = strlen (*p); 51 memcpy (d, *p, i+1); 52 d += i+1; 138 53 } 139 ADD (1); 140 *arg_ptr++ = 0; 141 rc = DosExecPgm (obj, sizeof (obj), exec_flag, arg_buf, 142 (const char *)np->env_off, &res, pgm_name); 143 if (arg_buf != NULL) 144 _tfree (arg_buf); 145 if (rc != 0) 54 *d = 0; 55 size = 0; n = 0; 56 for (p = (const char * const *)argv; *p != NULL; ++p) 146 57 { 147 _sys_set_errno (rc); 148 return -1; 58 ++n; size += 2 + strlen (*p); 149 59 } 150 switch (mode & 0xff) 60 d = alloca (size); 61 np.arg_count = n; np.arg_size = size; 62 np.arg_off = (unsigned long)d; 63 for (p = (const char * const *)argv; *p != NULL; ++p) 151 64 { 152 case P_WAIT: 153 return res.codeResult; 154 case P_NOWAIT: 155 return res.codeTerminate; 156 case P_OVERLAY: 157 while (1) 158 DosExit (EXIT_PROCESS, 0); 159 default: 160 errno = EINVAL; 161 return -1; 65 i = strlen (*p); 66 *d++ = _ARG_NONZERO; 67 memcpy (d, *p, i+1); 68 d += i+1; 162 69 } 70 i = __spawnve (&np); 71 return i; 163 72 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/syscalls.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 52 52 While this variable is NULL, no memory has been allocated. */ 53 53 54 struct heap_obj *_sys_top_heap_obj;54 EXTERN struct heap_obj *_sys_top_heap_obj; 55 55 56 56 /* This array holds information on all the heap objects. The heap 57 57 objects are managed in LIFO fashion. */ 58 58 59 struct heap_obj _sys_heap_objs[MAX_HEAP_OBJS];59 EXTERN struct heap_obj _sys_heap_objs[MAX_HEAP_OBJS]; 60 60 61 61 /* This is the number of heap objects. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/ftime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 6 6 #include <emx/syscalls.h> 7 7 8 void _ftime (struct timeb *ptr)8 void ftime (struct timeb *ptr) 9 9 { 10 10 time_t t_loc; 11 11 12 if (!_tzset_flag) _tzset ();12 if (!_tzset_flag) tzset (); 13 13 __ftime (ptr); 14 14 t_loc = ptr->time; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/gettimeo.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 int _gettimeofday (struct timeval *tp, struct timezone *tzp)9 int gettimeofday (struct timeval *tp, struct timezone *tzp) 10 10 { 11 11 struct timeb tb; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/localtim.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 22 22 struct tm *p; 23 23 24 if (!_tzset_flag) _tzset ();24 if (!_tzset_flag) tzset (); 25 25 lt = *t; 26 26 isdst = _gmt2loc (<); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/mktime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 11 11 int dst; 12 12 13 if (!_tzset_flag) _tzset ();13 if (!_tzset_flag) tzset (); 14 14 15 /* _mktime() requires that tm_mon is in range. The other members15 /* mktime() requires that tm_mon is in range. The other members 16 16 are not restricted. */ 17 17 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/settimeo.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 #include <emx/syscalls.h> 8 8 9 int _settimeofday (const struct timeval *tp, const struct timezone *tzp)9 int settimeofday (const struct timeval *tp, const struct timezone *tzp) 10 10 { 11 11 struct timeval local; … … 17 17 return -1; 18 18 } 19 if (!_tzset_flag) _tzset ();19 if (!_tzset_flag) tzset (); 20 20 t = tp->tv_sec; 21 21 local.tv_sec = _gmt2loc (&t); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/strptime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 265 265 266 266 267 char * _strptime (const char *buf, const char *format, struct tm *tm)267 char *strptime (const char *buf, const char *format, struct tm *tm) 268 268 { 269 269 return (char *)parse_fmt ((const unsigned char *)buf, -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/time.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 8 8 struct timeb tb; 9 9 10 _ftime (&tb);10 ftime (&tb); 11 11 if (t != NULL) *t = tb.time; 12 12 return tb.time; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/times.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 7 7 /* Note: return value overflows */ 8 8 9 long _times (struct tms *buffer)9 long times (struct tms *buffer) 10 10 { 11 11 struct timeval tv; … … 15 15 buffer->tms_cutime = 0; 16 16 buffer->tms_cstime = 0; 17 if ( _gettimeofday (&tv, NULL) != 0)17 if (gettimeofday (&tv, NULL) != 0) 18 18 return -1; 19 19 return CLK_TCK * tv.tv_sec + (CLK_TCK * tv.tv_usec) / 1000000; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/tzset.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 105 105 106 106 107 void _tzset (void)107 void tzset (void) 108 108 { 109 109 struct _tzinfo ntz; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libend/end.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := The C runtime library that should be linked last 3 3 4 .TKIND := omf st4 .TKIND := omf 5 5 .TARGET := end$A 6 6 .TSRC.386 := $(wildcard src/lib/end/386/*.asm) 7 7 .TSRC := $(.TSRC.$(CPU)) 8 8 .INSDIR = lib/ 9 .TKEEP := 110 9 include mklib.smak 11 12 .TKIND := omf mt13 include mklib.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libmoddef/moddef.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := A library for working with .DEF files 3 3 4 .TKIND := aout st4 .TKIND := aout 5 5 .TARGET := moddef$A 6 6 .TSRC := $(wildcard src/lib/moddef/*.c) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libomflib/omflib.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 2 2 .MDESC := A library for reading/writing OMF object files 3 3 4 .TKIND := aout st4 .TKIND := aout 5 5 .TARGET := omflib$A 6 6 .TSRC := $(wildcard src/lib/omflib/*.c) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/regexp/regexp.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r122 r123 3 3 .INSDIR := lib/ 4 4 5 .TARGET := regexp .a5 .TARGET := regexp$A 6 6 .TSRC := $(wildcard src/regexp/*.c) 7 7 include mklib.smak -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.