Sponsored Content
Full Discussion: 'int' Unix to Linux!! Help!!
Operating Systems Linux Red Hat 'int' Unix to Linux!! Help!! Post 302354572 by roosse77i on Friday 18th of September 2009 03:51:50 PM
Old 09-18-2009
'int' Unix to Linux!! Help!!

Hi!
I'm having some troubles to make a Unix system communicate with a Linux system, because the LSB and MSB of an 'int' is inverted in each other.
I can't use a Algorithm for Bit Reversal, because I would have to change a lot of the services that I use im my application.
Is there any way to change the LSB and MSB of the 'int' inside of Linux?

Sorry for my english mistakes, and sorry for may newbie explication. This is the first time that I'm using Linux this way.
 

10 More Discussions You Might Find Interesting

1. Programming

Unsigned int

How can I store and/or print() a number that is larger than 4 294 967 295 in C? is int64_t or u_int64_t what I need ? if, so how can I printf it to stdout? (2 Replies)
Discussion started by: nimnod
2 Replies

2. Programming

difference between int ** func() and int *& func()

What is the difference between int** func() and int*& func(). Can you please explain it with suitable example. Thanks, Devesh. (1 Reply)
Discussion started by: devesh
1 Replies

3. UNIX for Dummies Questions & Answers

can unix program declare int?

can unix program declare int??how to declare ? if i want to declare int and using read command then compare which int is small...how to do this??can somebody help me? (1 Reply)
Discussion started by: yeah016
1 Replies

4. Programming

to get the correct value with unsigned int

hi, Please help me with the following code to get the difference in values. struct a{ int b1; int c1; char d1; } main() { unsigned int b=10; unsigned int c; c = b - (unsigned int )sizeof(a); printf("%d",c); } Here c returns some junk value. How can i get the... (2 Replies)
Discussion started by: naan
2 Replies

5. UNIX for Dummies Questions & Answers

int open(const char *pathname, int flags, mode_t mode) doubt...

hello everybody! I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code: #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main(){ int fileDescriptor; fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies

6. Programming

int *ptr + max possible value

From reading my C book, Im aware that the integers have a maximum value which depends on what type of processor you are using (since they use 16-bit or 32-bit instructions). Now I know pointers are very flexible, since they can reference anything, but in the case of integer pointers, can they... (4 Replies)
Discussion started by: JamesGoh
4 Replies

7. Shell Programming and Scripting

From string to int ?

hello guys i m new to shell scripting and can't find out why this structure is not right I m guessing this happens because $LINESUM is a string . so how can i do this ? i want my script to do so many loops as the number of the lines of one custom file. #!/bin/bash echo give me path name... (5 Replies)
Discussion started by: xamxam
5 Replies

8. Programming

Handle int listen(int sockfd, int backlog) in TCP

Hi, from the manual listen(2): listen for connections on socket - Linux man page It has a parameter called backlog and it limits the maximum length of queue of pending list. If I set backlog to 128, is it means no more than 128 packets can be handled by server? If I have three... (3 Replies)
Discussion started by: sehang
3 Replies

9. Programming

'int air_date' '%'?

int air_date='20100103'; //2010 - Jan - 03 /* My goal here is to subtract a day. */ int day = air_date % 100; //?????? Is this right? //Are there any functions time/date for this type of date format? :cool: (7 Replies)
Discussion started by: sepoto
7 Replies

10. Fedora

Which is the better platform to learn UNIX/Linux (Kali Linux Vs. Red Hat or other)?

I just started a new semester and I started my UNIX class yesterday. I've already decided to use python along with my learning process but what I really want to use with it is Kali as my UNIX/Linux platform to learn off of since I already wanted to learn Cyber Sec. anyways. I just wanted to know if... (12 Replies)
Discussion started by: ApacheOmega
12 Replies
Slurm::Bitstr(3pm)					User Contributed Perl Documentation					Slurm::Bitstr(3pm)

NAME
Slurm::Bitstr - Bitstring functions in libslurm SYNOPSIS
use Slurm; $bitmap = Slurm::Bitstr::alloc(32); if ($bitmap->test(10)) { print "bit 10 is set "; } DESCRIPTION
The Slurm::Bitstr class is a wrapper of the bit string functions in libslurm. This package is loaded and bootstrapped with package Slurm. METHODS
$bitmap = Slurm::Bitstr::alloc($nbits); Allocate a bitstring object with $nbits bits. An opaque bitstr object is returned. This is a CLASS METHOD. $bitmap->realloc($nbits); Reallocate a bitstring(expand or contract size). $nbits is the number of bits in the new bitstring. $len = $bitmap->size(); Return the number of possible bits in a bitstring. $cond = $bitmap->test($n); Check if bit $n of $bitmap is set. $bitmap->set($n); Set bit $n of $bitmap. $bitmap->clear($n); Clear bit $n of $bitmap. $bitmap->nset($start, $stop); Set bits $start .. $stop in $bitmap. $bitmap->nclear($start, $stop); Clear bits $start .. $stop in $bitmap. $pos = $bitmap->ffc(); Find first bit clear in $bitmap. $pos = $bitmap->nffc($n) Find the first $n contiguous bits clear in $bitmap. $pos = $bitmap->noc($n, $seed); Find $n contiguous bits clear in $bitmap starting at offset $seed. $pos = $bitmap->nffs($n); Find the first $n contiguous bits set in $bitmap. $pos = $bitmap->ffs(); Find first bit set in $bitmap; $pos = $bitmap->fls(); Find last bit set in $bitmap; $bitmap->fill_gaps(); Set all bits of $bitmap between the first and last bits set(i.e. fill in the gaps to make set bits contiguous). $cond = $bitmap1->super_set($bitmap2); Return 1 if all bits set in $bitmap1 are also set in $bitmap2, 0 otherwise. $cond = $bitmap1->equal($bitmap2); Return 1 if $bitmap1 and $bitmap2 are identical, 0 otherwise. $bitmap1->and($bitmap2); $bitmap1 &= $bitmap2. $bitmap->not(); $bitmap = ~$bitmap. $bitmap1->or($bitmap2); $bitmap1 |= $bitmap2. $new = $bitmap->copy(); Return a copy of the supplied bitmap. $dest_bitmap->copybits($src_bitmap); Copy all bits of $src_bitmap to $dest_bitmap. $n = $bitmap->set_count(); Count the number of bits set in bitstring. $n = $bitmap1->overlap($bitmap2); Return number of bits set in $bitmap1 that are also set in $bitmap2, 0 if no overlap. $n = $bitmap->clear_count(); Count the number of bits clear in bitstring. $n = $bitmap->nset_max_count(); Return the count of the largest number of contiguous bits set in $bitmap. $sum = $bitmap->inst_and_set_count($int_array); And $int_array and $bitmap and sum the elements corresponding to set entries in $bitmap. $new = $bitmap->rotate_copy($n, $nbits); Return a copy of $bitmap rotated by $n bits. Number of bit in the new bitmap is $nbits. $bitmap->rotate($n); Rotate $bitmap by $n bits. $new = $bitmap->pick_cnt($nbits); Build a bitmap containing the first $nbits of $bitmap which are set. $str = $bitmap->fmt(); Convert $bitmap to range string format, e.g. 0-5,42 $rc = $bitmap->unfmt($str); Convert range string format to bitmap. $array = Slurm::Bitstr::bitfmt2int($str); Convert $str describing bitmap (output from fmt(), e.g. "0-30,45,50-60") into an array of integer (start/edn) pairs terminated by -1 (e.g. "0, 30, 45, 45, 50, 60, -1"). $str = $bitmap->fmt_hexmask(); Given a bit string, allocate and return a string in the form of: "0x0123ABC" ^ ^ | | MSB LSB $rc = $bitmap->unfmt_hexmask($str); Give a hex mask string "0x0123ABC", convert to a bit string. ^ ^ | | MSB LSB $str = $bitmap->fmt_binmask(); Given a bit string, allocate and return a binary string in the form of: "0001010" ^ ^ | | MSB LSB $rc = $bitmap->unfmt_binmask($str); Give a bin mask string "0001010", convert to a bit string. ^ ^ | | MSB LSB $pos = $bitmap->get_bit_num($n); Find position of the $n-th set bit(0 based, i.e., the first set bit is the 0-th) in $bitmap. Returns -1 if there are less than $n bits set. $n = $bitmap->get_pos_num($pos); Find the number of bits set minus one in $bitmap between bit postion [0 .. $pos]. Returns -1 if no bits are set between [0 .. $pos]. SEE ALSO
Slurm AUTHOR
This library is created by Hongjia Cao, <hjcao(AT)nudt.edu.cn> and Danny Auble, <da(AT)llnl.gov>. It is distributed with SLURM. COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2012-03-16 Slurm::Bitstr(3pm)
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy