7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.3 1996/07/25 19:45:24 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.4 1996/08/14 05:01:53 scrappy Exp $
11
11
*
12
12
* NOTES
13
13
*
@@ -60,6 +60,7 @@ static struct ONEXIT {
60
60
} onexit_list [ MAX_ON_EXITS ];
61
61
62
62
static int onexit_index ;
63
+ static void IpcConfigTip ();
63
64
64
65
typedef struct _PrivateMemStruct {
65
66
int id ;
@@ -272,6 +273,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
272
273
273
274
if (semId < 0 ) {
274
275
perror ("semget" );
276
+ IpcConfigTip ();
275
277
exitpg (3 );
276
278
}
277
279
for (i = 0 ; i < semNum ; i ++ ) {
@@ -281,6 +283,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
281
283
errStatus = semctl (semId , 0 , SETALL , semun );
282
284
if (errStatus == -1 ) {
283
285
perror ("semctl" );
286
+ IpcConfigTip ();
284
287
}
285
288
286
289
if (removeOnExit )
@@ -320,7 +323,10 @@ IpcSemaphoreSet(int semId, int semno, int value)
320
323
IpcSemaphoreSet_return = errStatus ;
321
324
322
325
if (errStatus == -1 )
326
+ {
323
327
perror ("semctl" );
328
+ IpcConfigTip ();
329
+ }
324
330
}
325
331
326
332
/****************************************************************************/
@@ -377,6 +383,7 @@ IpcSemaphoreLock(IpcSemaphoreId semId, int sem, int lock)
377
383
378
384
if (errStatus == -1 ) {
379
385
perror ("semop" );
386
+ IpcConfigTip ();
380
387
exitpg (255 );
381
388
}
382
389
}
@@ -419,6 +426,7 @@ IpcSemaphoreUnlock(IpcSemaphoreId semId, int sem, int lock)
419
426
420
427
if (errStatus == -1 ) {
421
428
perror ("semop" );
429
+ IpcConfigTip ();
422
430
exitpg (255 );
423
431
}
424
432
}
@@ -466,6 +474,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
466
474
fprintf (stderr ,"IpcMemoryCreate: memKey=%d , size=%d , permission=%d" ,
467
475
memKey , size , permission );
468
476
perror ("IpcMemoryCreate: shmget(..., create, ...) failed" );
477
+ IpcConfigTip ();
469
478
return (IpcMemCreationFailed );
470
479
}
471
480
@@ -490,6 +499,7 @@ IpcMemoryIdGet(IpcMemoryKey memKey, uint32 size)
490
499
fprintf (stderr ,"IpcMemoryIdGet: memKey=%d , size=%d , permission=%d" ,
491
500
memKey , size , 0 );
492
501
perror ("IpcMemoryIdGet: shmget() failed" );
502
+ IpcConfigTip ();
493
503
return (IpcMemIdGetFailed );
494
504
}
495
505
@@ -530,6 +540,7 @@ IpcMemoryAttach(IpcMemoryId memId)
530
540
/* if ( *memAddress == -1) { XXX ??? */
531
541
if ( memAddress == (char * )-1 ) {
532
542
perror ("IpcMemoryAttach: shmat() failed" );
543
+ IpcConfigTip ();
533
544
return (IpcMemAttachFailed );
534
545
}
535
546
@@ -706,3 +717,11 @@ LockIsFree(int lockid)
706
717
}
707
718
708
719
#endif /* HAS_TEST_AND_SET */
720
+
721
+ static void
722
+ IpcConfigTip ()
723
+ {
724
+ fprintf (stderr ,"This type of error is usually caused by improper\n" );
725
+ fprintf (stderr ,"shared memory or System V IPC semaphore configuration.\n" );
726
+ fprintf (stderr ,"See the FAQ for more detailed information\n" );
727
+ }
0 commit comments