@@ -26,7 +26,7 @@ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIA
26
26
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
27
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
28
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
29
+ kOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
30
30
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
31
32
32
**********************************************************************************/
@@ -635,6 +635,8 @@ static int open_shmem(void) {
635
635
636
636
int try = 0 ;
637
637
638
+ int err = 0 ;
639
+
638
640
do {
639
641
640
642
#if defined(BIGNUMA )
@@ -652,18 +654,22 @@ static int open_shmem(void) {
652
654
#endif
653
655
}
654
656
657
+ if (shmid == -1 ) err = errno ;
658
+
655
659
try ++ ;
656
660
657
661
} while ((try < 10 ) && (shmid == -1 ));
658
662
659
663
if (shmid == -1 ) {
660
- perror ("Obtaining shared memory segment failed in open_shmem" );
664
+ fprintf (stderr , "Obtaining shared memory segment failed in open_shmem: %s\n" ,strerror (err ));
665
+ fprintf (stderr , "Setting CPU affinity not possible without shared memory access.\n" );
661
666
return (1 );
662
667
}
663
668
664
669
if (shmid != -1 ) {
665
670
if ( (common = shmat (shmid , NULL , 0 )) == (void * )-1 ) {
666
671
perror ("Attaching shared memory segment failed in open_shmem" );
672
+ fprintf (stderr , "Setting CPU affinity not possible without shared memory access.\n" );
667
673
return (1 );
668
674
}
669
675
}
@@ -679,11 +685,13 @@ static int create_pshmem(void) {
679
685
680
686
if (pshmid == -1 ) {
681
687
perror ("Obtaining shared memory segment failed in create_pshmem" );
688
+ fprintf (stderr , "Setting CPU affinity not possible without shared memory access.\n" );
682
689
return (1 );
683
690
}
684
691
685
692
if ( (paddr = shmat (pshmid , NULL , 0 )) == (void * )-1 ) {
686
693
perror ("Attaching shared memory segment failed in create_pshmem" );
694
+ fprintf (stderr , "Setting CPU affinity not possible without shared memory access.\n" );
687
695
return (1 );
688
696
}
689
697
0 commit comments