The HP-UX 64-bit data model is called LP64 because longs and pointers are 64 bits. In this model, ints remain 32 bits.
The LP64 data model is the emerging standard on 64-bit UNIX systems provided by leading system vendors. Applications that transition to the LP64 data model on HP-UX systems are highly portable to other LP64 vendor platforms.
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)
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)
Hello everey one,
here i am attempting to compile a c++ project .it's throughing the following errors.
my machine details are as follows:
Linux chmclozr0119 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
errors:
=====
Generating... (0 Replies)
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)
My question is simple: When should I use a long, int, char, unsigned/signed variables??
When I declare a variable "unsigned;" what did I do it???
Why would I delcare an integer "long" or "short" ( unsigned or signed)??
Any examples of when things like "unsigned", "long", "short" etc...... (6 Replies)
when a date type is considered signed and unsigned is that simple referring to - for signed and positive numbers for unsigned? Further if that is the case would mutiplying and dividing ect where 2 signed numbers, like (-2)*(-2) = 4 result in a unsigned. (3 Replies)
Hi,
I am unable to assign value zero to my variable which is defined as unsigned char.
typedef struct ABCD
{
unsigned char abc;
unsigned char def;
unsigned char ghi;
} ABCD;
typedef ABCD *PABCD;
In my Por*C code, i assign the values using memcpy like below
... (3 Replies)
Hi guys...
Macbook Pro, 13", circa August 2012, OSX 10.7.5, default bash terminal.
I require the capability to convert +32767 to -32768 into signed hex words...
The example piece code below works perfectly except...
#/bin/bash
# sign.sh
# Unsign to sign...
while true
do
# I have used... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT SUSE
ddi_mmap_get_model
ddi_mmap_get_model(9F) Kernel Functions for Drivers ddi_mmap_get_model(9F)NAME
ddi_mmap_get_model - return data model type of current thread
SYNOPSIS
#include <sys/ddi.h>
#include <sys/sunddi.h>
uint_t ddi_mmap_get_model(void);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
DESCRIPTION
ddi_mmap_get_model() returns the C Language Type Model which the current thread expects. ddi_mmap_get_model() is used in combination with
ddi_model_convert_from(9F) in the mmap(9E) driver entry point to determine whether there is a data model mismatch between the current
thread and the device driver. The device driver might have to adjust the shape of data structures before exporting them to a user thread
which supports a different data model.
RETURN VALUES
"small and bold">DDI_MODCurrent2thread expects 32-bit (ILP32) semantics.
DDI_MODEL_LP64 Current thread expects 64-bit (LP64) semantics.
DDI_FAILURE The ddi_mmap_get_model() function was not called from the mmap(9E) entry point.
CONTEXT
The ddi_mmap_get_model() function can only be called from the mmap(9E) driver entry point.
EXAMPLES
Example 1: : Using ddi_mmap_get_model()
The following is an example of the mmap(9E) entry point and how to support 32-bit and 64-bit applications with the same device driver.
struct data32 {
int len;
caddr32_t addr;
};
struct data {
int len;
caddr_t addr;
};
xxmmap(dev_t dev, off_t off, int prot) {
struct data dtc; /* a local copy for clash resolution */
struct data *dp = (struct data *)shared_area;
switch (ddi_model_convert_from(ddi_mmap_get_model())) {
case DDI_MODEL_ILP32:
{
struct data32 *da32p;
da32p = (struct data32 *)shared_area;
dp = &dtc;
dp->len = da32p->len;
dp->address = da32->address;
break;
}
case DDI_MODEL_NONE:
break;
}
/* continues along using dp */
...
}
SEE ALSO mmap(9E), ddi_model_convert_from(9F)
Writing Device Drivers
SunOS 5.10 8 Feb 2001 ddi_mmap_get_model(9F)