[ofw] RE: OpenSM patches for saquery porting - 2 of 6 patches.

Stan C. Smith stan.smith at intel.com
Mon Feb 2 11:16:33 PST 2009


After spending more time looking into opensm, while the real goal was saquery, the best approach for now is to not
address opensm getopt cleanup. OpenSM, ibtrapgen, opensmtest all use the function getopt_long_only() which is not part
of etc\user\getopt.c. Removing getopt_long_only() can be addressed in another patch for opensm.

Please commit previous OpenSM patches with the following (.patch file included) superceeding patch #2.

BTW, the EOL char in the SVN file winosm_common.h is Linux, would you kindly convert the EOL to Windows format?

Thank you,

Stan.


diff U3 C:/Documents and Settings/scsmith/Local Settings/Temp/winosm_common.h-revBASE.svn001.tmp.h C:/Documents and
Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/ulp/opensm/user/include/vendor/winosm_common.h
--- C:/Documents and Settings/scsmith/Local Settings/Temp/winosm_common.h-revBASE.svn001.tmp.h	Mon Feb 02 10:49:39 2009
+++ C:/Documents and Settings/scsmith/My
Documents/openIB-windows/SVN/gen1/trunk/ulp/opensm/user/include/vendor/winosm_common.h	Mon Feb 02 10:49:21 2009
@@ -18,17 +18,16 @@
 };
 
 
+
+#ifndef _GETOPT_H_ 
+
 # define no_argument		0
 # define required_argument	1
 # define optional_argument	2
+
 /* Global variables for getopt_long */
 char *optarg;
-/*
-extern int optind;
-extern int opterr;
-extern int optopt;
-extern int iArg;
-  */
+
 struct option
 {
   const char *name;
@@ -36,6 +35,7 @@
   int *flag;
   int val;
 };
+#endif
 
 
 /************************************************************************/
@@ -162,9 +162,10 @@
 /*****************************************************************************/
 
 
-
-
+#ifndef getpid
 #define getpid() GetCurrentProcessId()
+#endif
+
 #define sleep(sec) SleepEx((sec)*1000,TRUE)
 #define usleep(usec) SleepEx(usec/1000,TRUE)
 //#define MT_ALIGN8	__declspec(align(8))
@@ -172,7 +173,11 @@
 #ifndef ETIMEDOUT
 #define ETIMEDOUT		(10060)
 #endif
+
+#ifndef strtoull 
 #define strtoull _strtoui64
+#endif
+
 #define OSM_MAX_LOG_NAME_SIZE 2048
 #define unlink(str) _unlink(str)
 #define strnicmp _strnicmp





Tzachi Dar wrote:
> Sean and Stan,
> 
> Have you reached a conclusion of how to use getopt?
> 
> Can we commit the original patch?
> 
> Thanks
> Tzachi
> 
>> -----Original Message-----
>> From: ofw-bounces at lists.openfabrics.org
>> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Sean Hefty
>> Sent: Saturday, January 31, 2009 1:08 AM
>> To: Smith, Stan; Yevgeny Kliteynik
>> Cc: ofw at lists.openfabrics.org
>> Subject: [ofw] RE: OpenSM patches for saquery porting - 2 of 6
>> patches. 
>> 
>>> +
>>> +#ifndef _GETOPT_H_
>>> /* Global variables for getopt_long */  char *optarg; /*
>>> @@ -36,6 +38,7 @@
>>>   int *flag;
>>>   int val;
>>> };
>>> +#endif
>>> 
>>> 
>>> 
>>> /************************************************************
>>> ********** **/ @@ -43,11 +46,14 @@
>>> get_char_option(const char* optstring,
>>>                              char*const* argv,int argc,
>>>                              int iArg, int* opt_ind,char* opt_p); +
>>> int
>>> getopt_long_only(int argc, char *const*argv,
>>>                          const char *optstring,
>>>                          const struct option *longopts, int
>>> *longindex); 
>>> 
>> /*********************************************************************
>>> *****/
>> 
>> The duplicate implementation of getopt should just be
>> removed, with the code using the common one provided by
>> etc\user\getopt.c and inc\user\getopt.h.
>> 
>> 
>> 
>> _______________________________________________
>> ofw mailing list
>> ofw at lists.openfabrics.org
>> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winosm_common.h.patch
Type: application/octet-stream
Size: 1499 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090202/15120ddd/attachment.obj>


More information about the ofw mailing list