[stgt] [PATCH 14/15] tgt: os.h: semtimedop for BSD

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Mar 2 08:22:18 CET 2009


On Sun,  1 Mar 2009 18:55:57 +0200
Boaz Harrosh <bharrosh at panasas.com> wrote:

> emulate semtimedop with plain semop on bsd
> 
> Signed-off-by: Boaz Harrosh <bharrosh at panasas.com>
> ---
>  usr/log.c |    1 +
>  usr/os.h  |    5 +++++
>  2 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/usr/log.c b/usr/log.c
> index 056314a..9154626 100644
> --- a/usr/log.c
> +++ b/usr/log.c
> @@ -30,6 +30,7 @@
>  #include <sys/types.h>
>  #include <sys/wait.h>
>  
> +#include "os.h"
>  #include "log.h"
>  
>  #define SEMKEY	0xA7L
> diff --git a/usr/os.h b/usr/os.h
> index 9908bb5..77944b3 100644
> --- a/usr/os.h
> +++ b/usr/os.h
> @@ -22,4 +22,9 @@ struct sockaddr_storage;
>  int os_getnameinfo_ss(struct sockaddr_storage *ss, char *host, size_t hostlen,
>                        char *serv, size_t servlen, int flags);
>  
> +#ifdef __MAKE_TGT_ON_BSD__
> +#define semtimedop(semid, sops, nsops, timeout) \
> +	semop(semid, sops, nsops)
> +#endif

BSDes don't have semtimedop? We can't sleep so we use semtimedop. This
emulation is broken, but it's fine by me for now.

But I don't like ifdef. Why not be consistent with other portability
code, just creating do_semtimedop or something.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list