Changeset 463 for trunk/server
- Timestamp:
- Jun 10, 2010, 11:16:45 AM (15 years ago)
- Location:
- trunk/server/source3
- Files:
-
- 1 deleted
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/Makefile.in
r454 r463 391 391 $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \ 392 392 lib/interface.o lib/pidfile.o \ 393 lib/system.o lib/os2 ea.o lib/os2path.o lib/sendfile.o lib/recvfile.o lib/time.o \393 lib/system.o lib/os2helper.o lib/sendfile.o lib/recvfile.o lib/time.o \ 394 394 lib/username.o \ 395 395 ../libds/common/flag_mapping.o \ -
trunk/server/source3/build.cmd
r456 r463 16 16 say " BRAND - create a branded build" 17 17 say " MAKE - just compile changed files" 18 say " CLUT - build command line utilities only (N/A)"19 say " WPI - create WPI archive (N/A)"20 say " ZIP - create ZIP archive 21 say " ALL - do just everything (N/A)"18 say " CLUT - build command line utilities only" 19 say " WPI - create WPI archive" 20 say " ZIP - create ZIP archive" 21 say " ALL - do just everything" 22 22 say 23 23 exit 255 … … 32 32 33 33 /* defaults */ 34 make = " CLEAN"34 make = "" 35 35 libc = "064x" 36 36 brand = "No" 37 37 conf = "" 38 verstring = 'x.x.x-3.x.x.xxx-eCS-'date('S') /* for packaging if branding is disabled */ 38 39 39 40 /* Read profile */ … … 42 43 opt_line = translate(linein(options)) 43 44 interpret opt_line 45 call charout , opt_line' ' 44 46 end 47 say 45 48 ok = stream(options,'c','close') 46 49 … … 85 88 if conf = "YES" then do 86 89 address cmd 'SETLOCAL' 87 /* we do not need that88 90 address cmd 'SET CFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4' 89 91 address cmd 'SET CXXFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4' … … 91 93 address cmd 'SET AR=emxomfar' 92 94 address cmd 'SET LIBS=-lsocket -lsyslog' 93 */94 95 /* disabled options: 95 96 --enable-developer --enable-socket-wrapper … … 105 106 if brand = "YES" then do 106 107 svninfo = ".\svninfo" 107 address cmd 'svn info | grep "^Revision:" | sed -e "s/Revision: *//">'svninfo108 address cmd 'svn status -q -u | grep "^Status against revision:" | sed -e "s/Status against revision: *//">'svninfo 108 109 revision = strip(translate(linein(svninfo))) 109 110 ok = stream(svninfo,'c','close') … … 111 112 end 112 113 113 say build_parms 114 'make 2>&1 | tee build.log' 114 if make <> "" then do 115 say build_parms 116 address cmd 'make 2>&1 | tee build.log' 117 end 115 118 116 119 if pos("ZIP", cmdline) > 0 then do 120 say 'Creating "samba-'translate(verstring,'-',' ')'.zip"' 121 ok = SysFileDelete('samba-'translate(verstring,'-',' ')'.zip') 117 122 'cd .\bin' 118 123 'md .\samba' 119 124 'cd .\samba' 120 'move ..\*.exe '121 'move ..\*.dll '125 'move ..\*.exe >NUL' 126 'move ..\*.dll >NUL' 122 127 'cd ..' 123 'zip -rpmo9 samba-NEW.zip .\samba\*.exe .\samba\*.dll' 128 'zip -rpo9 samba-'translate(verstring,'-',' ')'.zip .\samba\*.exe .\samba\*.dll' 129 'cd .\samba' 130 'move * .. >NUL' 131 'cd ..' 124 132 'rd .\samba' 125 133 say 'Created ZIP package' … … 129 137 exit 0 130 138 131 brand: procedure 139 brand: procedure expose verstring 132 140 parse arg revision 133 141 134 142 /* eComStation Version file */ 135 143 VerFile = "VERSION.ECS" 136 137 /* is the file available */138 ok = stream(VerFile, 'c', 'QUERY EXISTS')139 if ok = "" then do140 say 'Please create a VERSION.ECS based on VERSION.EC_'141 exit 0142 end143 144 144 145 /* Samba Version file */ … … 151 152 I = I + 1 152 153 eCSVer.I = linein(VerFile) 154 if left(eCSVer.I,28) = "SAMBA_VERSION_VENDOR_SUFFIX=" then do 155 parse var eCSver.I . '='vendor_suffix 156 vendor_suffix = strip(vendor_suffix,,'"') 157 parse var vendor_suffix vendor suffix 158 end 153 159 end 154 160 ok = stream(VerFile, 'c', 'close') … … 161 167 do until lines(VERSION) = 0 162 168 verline = linein(VERSION) 169 if left(Verline,20) = "SAMBA_VERSION_MAJOR=" then do 170 parse var verline . '='Major 171 end 172 if left(Verline,20) = "SAMBA_VERSION_MINOR=" then do 173 parse var verline . '='Minor 174 end 175 if left(Verline,22) = "SAMBA_VERSION_RELEASE=" then do 176 parse var verline . '='release 177 end 178 163 179 do I = 1 to eCSVer.0 164 180 parse var eCSVer.I tag'='strvalue … … 173 189 ok = stream(Version,'c','close') 174 190 ok = stream(NewVersion,'c','close') 175 address cmd "ksh ./script/mkversion.sh "NewVersion 191 address cmd "ksh ./script/mkversion.sh "NewVersion" >NUL" 176 192 ok = SysFileDelete(NewVersion) 177 return 193 verstring = suffix'-'Major'.'minor'.'release'.'revision'-'vendor'-'date('S') 194 say "Samba "verstring 195 return -
trunk/server/source3/lib/os2helper.c
r454 r463 1 /* This file contains helper functions for OS/2 - don't try and compile on other platforms */ 1 /* This file contains helper functions for OS/2 - 2 do not try to compile on other platforms! */ 2 3 3 4 #ifdef __OS2__ … … 10 11 #define INCL_DOSMODULEMGR 11 12 #define INCL_DOSERRORS 12 //_SMB_H 13 13 14 #include <os2.h> 14 15 #include <stdio.h> … … 16 17 #include <errno.h> 17 18 #include <types.h> 18 19 #include <string.h> 19 20 //YD for tmalloc 20 21 #include <malloc.h> … … 42 43 #endif 43 44 44 #include <string.h>45 46 45 #ifndef ENOATTR 47 46 #define ENOATTR 22 … … 50 49 int os2_ftruncate(int fd, off_t size) 51 50 { 52 // We call there __libc_Back_ioFileSizeSet directly instead of 53 // ftruncate to force it not to zero expanding files to optimize 54 // samba performance when copying files 51 /* We call __libc_Back_ioFileSizeSet directly instead of 52 ftruncate to force it not to zero expanding files to optimize 53 samba performance when copying files */ 54 55 55 int rc = __libc_Back_ioFileSizeSet(fd, size, 0); 56 56 if (rc < 0) … … 90 90 rc = DosFindClose(hdirFindHandle); /* Close our directory handle */ 91 91 return 1; 92 93 92 } else { 94 93 rc = DosFindClose(hdirFindHandle); /* Close our directory handle */ 95 94 return 0; 96 97 95 } /* endif */ 98 99 } 100 101 /* Functions below are based on APR random code */ 102 /* Licensed to the Apache Software Foundation (ASF) under one or more 103 * contributor license agreements. See the NOTICE file distributed with 104 * this work for additional information regarding copyright ownership. 105 * The ASF licenses this file to You under the Apache License, Version 2.0 106 * (the "License"); you may not use this file except in compliance with 107 * the License. You may obtain a copy of the License at 108 * 109 * http://www.apache.org/licenses/LICENSE-2.0 110 * 111 * Unless required by applicable law or agreed to in writing, software 112 * distributed under the License is distributed on an "AS IS" BASIS, 113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 114 * See the License for the specific language governing permissions and 115 * limitations under the License. 116 */ 117 96 } 97 98 // we search the path of the .exe and return it 99 int os2_GetExePath(char *buff) 100 { 101 APIRET rc = NO_ERROR; 102 PPIB ppib = NULL; 103 char sExePath [_MAX_PATH]; 104 char sDrive [_MAX_PATH], sDir [_MAX_DIR]; 105 106 // we search for the infoblock to get the module name 107 rc = DosGetInfoBlocks(NULL, &ppib); 108 if (rc != NO_ERROR) 109 { 110 return -1; 111 } 112 113 // with the module name we get the path (including the exe name) 114 rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExePath), sExePath); 115 if (rc != NO_ERROR) 116 { 117 return -1; 118 } 119 120 // we split to the different values 121 _splitpath(sExePath, sDrive, sDir, NULL, NULL); 122 // strcat(sDrive, sDir); 123 strncat(sDrive, sDir, strlen(sDir) -1); 124 strcpy(buff, sDrive); 125 126 return 0; 127 } 128 129 /* OS/2-specific random functions. these functions used to be based on APR 130 random code, but we discovered some nasty problems with it on fast hardware 131 (especially on quadcore) and decided to rewrite it with libc random() */ 132 118 133 void os2_randget(char * buffer, int length) 119 134 { … … 126 141 } 127 142 128 /* A bunch of system information like memory & process stats.129 * Not highly random but every bit helps....130 */131 static UCHAR randbyte_sysinfo()132 {133 UCHAR byte = 0;134 UCHAR SysVars[100];135 int b;136 137 DosQuerySysInfo(1, QSV_FOREGROUND_PROCESS, SysVars, sizeof(SysVars));138 139 for (b = 0; b < 100; b++) {140 byte ^= SysVars[b];141 }142 143 return byte;144 }145 146 147 148 /* Similar in concept to randbyte_hrtimer() but accesses the CPU's internal149 * counters which run at the CPU's MHz speed. We get separate150 * idle / busy / interrupt cycle counts which should provide very good151 * randomness due to interference of hardware events.152 * This only works on newer CPUs (at least PPro or K6) and newer OS/2 versions153 * which is why it's run-time linked.154 */155 156 static HMODULE hDoscalls = 0;157 #define CMD_KI_RDCNT (0x63)158 159 typedef struct _CPUUTIL {160 ULONG ulTimeLow; /* Low 32 bits of time stamp */161 ULONG ulTimeHigh; /* High 32 bits of time stamp */162 ULONG ulIdleLow; /* Low 32 bits of idle time */163 ULONG ulIdleHigh; /* High 32 bits of idle time */164 ULONG ulBusyLow; /* Low 32 bits of busy time */165 ULONG ulBusyHigh; /* High 32 bits of busy time */166 ULONG ulIntrLow; /* Low 32 bits of interrupt time */167 ULONG ulIntrHigh; /* High 32 bits of interrupt time */168 } CPUUTIL;169 170 APIRET APIENTRY(*pfnDosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3) = NULL;171 APIRET APIENTRY(*pfnDosQuerySysState) (ULONG func, ULONG arg1, ULONG pid, ULONG _res_, PVOID buf, ULONG bufsz) = NULL;172 173 static UCHAR randbyte_perf()174 {175 UCHAR byte = 0;176 CPUUTIL util;177 int c;178 179 if (hDoscalls == 0) {180 char failed_module[20];181 ULONG rc;182 183 rc = DosLoadModule(failed_module, sizeof(failed_module), "DOSCALLS",184 &hDoscalls);185 186 if (rc == 0) {187 rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&pfnDosPerfSysCall);188 189 if (rc) {190 pfnDosPerfSysCall = NULL;191 }192 }193 }194 195 if (pfnDosPerfSysCall) {196 if ((*pfnDosPerfSysCall) (CMD_KI_RDCNT, (ULONG)&util, 0, 0) == 0) {197 for (c = 0; c < sizeof(util); c++) {198 byte ^= ((UCHAR *)&util)[c];199 }200 }201 else {202 pfnDosPerfSysCall = NULL;203 }204 }205 206 return byte;207 }208 209 210 211 143 UCHAR randbyte() 212 144 { 213 return randbyte_sysinfo() ^ randbyte_perf(); 145 int c; 146 UCHAR byte; 147 ULONG ulrandom; 148 ulrandom = random(); 149 150 for (c = 0; c < sizeof(ulrandom); c++) { 151 byte ^= ((UCHAR *)&ulrandom)[c]; 152 } 153 154 return byte; 214 155 } 215 156 -
trunk/server/source3/lib/select.c
r454 r463 110 110 errno = 0; 111 111 ret = select(maxfd,readfds2,writefds,errorfds,tval); 112 112 // @todo why are the above fd_set broken 113 113 if (ret <= 0) { 114 114 FD_ZERO(readfds2);
Note:
See TracChangeset
for help on using the changeset viewer.