***SPAM*** Re: [ofw] [PATCH] etc: add generic linux compatibility code

Hal Rosenstock hal.rosenstock at gmail.com
Tue Feb 24 13:09:13 PST 2009


On Tue, Feb 24, 2009 at 3:16 PM, Sean Hefty <sean.hefty at intel.com> wrote:
> To support the porting of OFED code, such as the infiniband-diags, provide a
> set of linux compatible include files and functions.
>
> This adds a set of header files under inc/user/linux so #include statements
> in code will find them.  In some cases, the header files are blank, but in
> others, they contain mappings between the linux calls and equivalent windows
> calls.
>
> Where more complex functionality is needed, source files are added under
> etc/user to provide it, similar to what was done for getopt.
>
> These headers and source files are used to support the OFED infiniband-diags
> in the WinOF build environment.
>
> Signed-off-by: Sean Hefty <sean.hefty at intel.com>
> ---
> Currently, only the ib-diags use these files, but other areas that might be able
> to use thesm include libibmad, dapl, perftest, libibverbs samples, librdmacm
> samples, and the mellanox hardware drivers.  Some time needs to be spent going
> through those areas to see what, if anything, should be pulled out to a common
> area.

<snip...>

> diff -up -r -N -X trunk\docs\dontdiff.txt -I '\$Id:' trunk\inc\user/linux/unistd.h branches\winverbs\inc\user/linux/unistd.h
> --- trunk\inc\user/linux/unistd.h       1969-12-31 16:00:00.000000000 -0800
> +++ branches\winverbs\inc\user/linux/unistd.h   2009-02-20 10:58:57.376687100 -0800
> @@ -0,0 +1,55 @@
> +/*
> + * Copyright (c) 2009 Intel Corp, Inc.  All rights reserved.
> + *
> + * This software is available to you under a choice of one of two
> + * licenses.  You may choose to be licensed under the terms of the GNU
> + * General Public License (GPL) Version 2, available from the file
> + * COPYING in the main directory of this source tree, or the
> + * OpenIB.org BSD license below:
> + *
> + *     Redistribution and use in source and binary forms, with or
> + *     without modification, are permitted provided that the following
> + *     conditions are met:
> + *
> + *      - Redistributions of source code must retain the above
> + *        copyright notice, this list of conditions and the following
> + *        disclaimer.
> + *
> + *      - Redistributions in binary form must reproduce the above
> + *        copyright notice, this list of conditions and the following
> + *        disclaimer in the documentation and/or other materials
> + *        provided with the distribution.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
> + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
> + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
> + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> + * SOFTWARE.
> + *
> + */
> +
> +#ifndef _UNISTD_H_
> +#define _UNISTD_H_
> +
> +#include <stdio.h>
> +
> +#define sleep(s) SleepEx(s * 1000, TRUE)
> +
> +static __inline int getdomainname(char *name, size_t len)
> +{
> +       return -1;
> +}
> +
> +static __inline char* getpass(char *message)
> +{
> +       static char password[128];
> +
> +       printf("%s", message);
> +       scanf_s("%127s", password, 128);

Is the password echoed ? If so, is there something that can be done to
obscure it ?

-- Hal

> +       return password;
> +}
> +
> +#endif /* _UNISTD_H_ */

<snip...>



More information about the ofw mailing list