このページを編集する際は、編集に関する方針に従ってください。
概要 †
引数 †
- int memKey --
- int size --
- int flag --
- key_t key --
- size_t size --
- int flags --
- int memKey --
- int size --
- int flag --
実装 †
int
shmget(int memKey, int size, int flag)
{
HANDLE hmap;
char szShareMem[32];
DWORD dwRet;
s_segsize = size;
sprintf(szShareMem, "PostgreSQL.%d", memKey);
if (flag & IPC_CREAT)
{
hmap = CreateFileMapping((HANDLE) 0xFFFFFFFF, /* Use the swap file */
NULL,
PAGE_READWRITE, /* Memory is Read/Write */
0L, /* Size Upper 32 Bits */
(DWORD) s_segsize, /* Size Lower 32 bits */
szShareMem);
}
else
{
hmap = OpenFileMapping(FILE_MAP_ALL_ACCESS,
FALSE,
szShareMem);
if (!hmap)
{
errno = ENOENT;
return -1;
}
}
dwRet = GetLastError();
if (dwRet == ERROR_ALREADY_EXISTS && hmap && (flag & (IPC_CREAT | IPC_EXCL)))
{
/* Caller wanted to create the segment -- error if already exists */
CloseHandle(hmap);
errno = EEXIST;
return -1;
}
else if (!hmap)
{
/* Unable to get shared memory */
_dosmaperr(GetLastError());
return -1;
}
return (int) hmap;
}
int
shmget(key_t key, size_t size, int flags)
{
char name[NAME_MAX + 1];
int oflag = 0;
struct shm_info info;
if (flags & IPC_CREAT)
oflag |= O_CREAT;
if (flags & IPC_EXCL)
oflag |= O_EXCL;
if (flags & SHM_R)
{
if (flags & SHM_W)
oflag |= O_RDWR;
else
oflag |= O_RDONLY;
}
info.shmid = shm_open(keytoname(key, name), oflag, MODE);
/* store shared memory information */
if (info.shmid != -1)
{
info.key = key;
info.size = size;
info.addr = NULL;
if (shm_putinfo(&info) == -1)
{
close(info.shmid);
if ((oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
shm_unlink(name);
return -1;
}
}
/* The size may only be set once. Ignore errors. */
ltrunc(info.shmid, size, SEEK_SET);
return info.shmid;
}
int
shmget(int memKey, int size, int flag)
{
char nom[50];
void *Address;
area_id parea;
/* Area name */
sprintf(nom, "SYSV_IPC_SHM : %d", memKey);
/* Find area */
parea = find_area(nom);
/* area exist, just return its id */
if (parea != B_NAME_NOT_FOUND)
return parea;
/* area does not exist and no creation is requested : error */
if (flag == 0)
return -1;
/*
* area does not exist and its creation is requested, create it (be sure
* to have a 4ko multiple size
*/
return create_area(nom, &Address, B_ANY_ADDRESS, ((size / 4096) + 1) * 4096, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
}
呼出元 †
備考 †
InternalIpcMemoryCreate()/postgresql-8.1.4より呼ばれていると思いページ作成したが、確認の結果、無関係だった。
履歴 †
コメント †
- KUcmnC http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com -- JimmiXS?
- A staff restaurant -- Rikky?
- One moment, please -- Quinn?
- I'd like to open a personal account -- Charles?
- How do I get an outside line? -- Benito?
- This site is crazy
-- Adalberto?
- Best Site Good Work -- Leonardo?
- This is your employment contract -- Bryant?
- Would you like a receipt? -- Steep777?
- On another call -- Shawn?
- Would you like to leave a message? -- Abram?
- I like watching football https://gist.github.com/5954c01724d35099167bc15fbac95a16 drip potter buy cheapest levitra hunting mantle Investors remained skittish about the deal. US Airways stock fell 1.2 percent to $16.17 on the New York Stock Exchange on Wednesday. AMR shares, which had been down nearly 17 percent, had recovered somewhat to end the day at $2.72, down 13.6 percent. Airline stocks fell about 6 percent after the lawsuit was filed on Tuesday, and were down 0.2 percent on Wednesday. -- Allen?
- Where do you study? https://gist.github.com/cf889e3586f17f6ade1dfae6c444c5c4 curiously crescent levitra prices australia odd jew LAGOS, Oct 23 (Reuters) - A walk along the two kilometres oflight rail that Lagos authorities have managed to build in threeyears gives a sense of how hard it is to impose order on one ofAfrica's most chaotic cities. -- Fausto?
- We're at university together https://gist.github.com/027d528d616df558005b2f711b812285 boundless play levitra to buy wrapping trapes A. Before African troops moved in, al-Shabab was making a steady income from duties and fees levied at ports and airports as well as extorting taxes on domestic produce and demanding "jihadi" contributions. A United Nations report estimated al-Shabab's income in 2011 at $70 million to $100 million. -- Edmund?
- Not available at the moment https://gist.github.com/a26e6c4e12857251cbeb417d6c11fb20 remarks expand levitra prices cvs passionate speaking "It is serious in that it was another problem caused bycarelessness, but I do not believe it is a seriously troublingdosage," Shunichi Tanaka, chairman of Japan's Nuclear RegulationAuthority, said on Wednesday. -- Elizabeth?
- I'm on holiday https://gist.github.com/b200265d369edbff00ed4edb797ebddf foreground buckwheat cheap levitra pills fugitive âI think youâre in a different system. Weâll see how he is in this system, how things work out in this system. I am in there with an open mind,â Ryan said. âSure, I know whatâs happened in the past. But if you really are focused on the past, am I supposed to go back one season? Or how far am I supposed to go back? To me Iâd rather focus on the present and whatâs in front of us to do evaluating.â -- Lucien?
- Which year are you in? https://gist.github.com/421e6aec3c111c29f938fbf1fe258de2 trumpet pasture levitra cheapest clank surprise The mansion has been officially named Casa Casuarina for more than a decade, operating first as a private club and then as a boutique hotel until earlier this year. But locals still refer to it as "the Versace mansion." It was initially listed for sale at $125 million last year. -- Kareem?
- Why did you come to ? https://gist.github.com/4bdb2fb4ac9c1297c90f7912a8315b59 vicinity levitra online pharmacy self jim In her study, Chang and her colleagues used the latest nationally representative data from a federal study called the National Health and Nutrition Examination Survey, which was done between 2007 and 2010. They used the data from an estimated 13.8 million adult Medicaid beneficiaries and 13.6 million adults who are potentially eligible for such coverage under ACA. -- Lonny?
- How much is a First Class stamp? https://gist.github.com/15c4f311b54af954a63914b73637529c beck levitra online india bradley The proximate cause was the meeting of the Federal Reserveand the subsequent statements by Chairman Ben Bernanke. Bernankesaid that if the U.S. economy continues its gradual path towardsstrength and stability, the Fed would consider ending itspurchases of $85 billion of bonds per month. Those statementsaccelerated what had begun a few weeks earlier, namely a sharprise in interest rates, with yields on U.S. 10-year Treasuriesrising above 2.5 percent after they had been hovering around 1.5percent. -- Hershel?
- What sort of music do you like? https://gist.github.com/690bc3500f2365bc9d2f703136a9b65e blizzard disdain levitra discount prices outbreak “He was scratching me and biting me in a playful manner, but it’s not playful when I’m not a lion,” she said. “I think that he thought that I was a lion because he wasn’t growling.” -- Casey?
- Who's calling? https://gist.github.com/94f0d63cd89a3d99e6d545c403bb7913 dumb curiosity cost of levitra waitress Ballmer is trying to bring products to the market faster andmake the company more efficient, and wants to entice people touse Microsoft products, like Word and Office, on a variety ofdevices besides personal computers. -- Corey?
- Punk not dead http://www.cfastresults.com/why-cfast/ individual conspicuous buy generic cymbalta canada general logs Joe was a foreign correspondent for the New York Times before he became a theater and movie critic for the New York Herald Tribune in 1959. He moved to Newsweek as movie critic in 1965 and was a columnist for the Los Angeles Herald Examiner from 1983 to 1988. He has written television scripts, including "The Boy in the Plastic Bubble" and several episodes of "Law & Order." Mr. Morgenstern is co-founder of the National Society of Film Critics. A graduate of Lehigh University, he won the 2005 Pulitzer Prize for criticism. -- Irwin?
- 8OujLc http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com -- JimmiXzS?
- XXzirl http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com -- JimmiXzS?
- CtXolJ http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com -- JimmiXzS?
- AJKHPK http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com -- JimmiXzS?
- naYEyF http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com -- JimmiXzS?
- rt6Noi http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com -- Barnypok?
- W9aclB http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com -- chaba?
- 2mXNSk http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com -- matt?
- 3bKtqy http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com -- chaba?
- u0YHU8 http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com -- matt?
- MMBAom http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com -- gordon?
- oJ1gcu http://www.y7YwKx7Pm6OnyJvolbcwrWdoEnRF29pb.com -- gordon?