-}
-void SnapshotGlobalSegments(){
- MyString fn = PROCNAME;
- static char sProcessSize[ 12 ] = { 0 };
- std::pair< const char *, bool > dataSect[ 2 ];
- dataSect[ 0 ] = std::make_pair( MYBINARYNAME, false );
- dataSect[ 1 ] = std::make_pair( MYLIBRARYNAME, false );
- static pid_t sProcID = 0;
- if( 0 == sProcID ) {
- sProcID = getpid();
- sprintf( sProcessSize, "%d", sProcID );
- }
- fn.replace( REPLACEPOS, 1, sProcessSize );
- std::ifstream procName( fn.c_str() );
- if( procName.is_open() ){
- MyString line;
- while( procName.good() ){
- getline( procName, line );
- int i;
- for( i = 0; i < 2; ++i ){
- if( MyString::npos != line.find( dataSect[ i ].first ) ) break;
- }
- if( i >= 2 || dataSect[ i ].second == true ) continue;
- dataSect[ i ].second = true;
- if( !procName.good() )return;
- getline( procName, line );
- takeSegmentSnapshot( line );
- }
- }