EXHIBIT 23.1 CONSENT OF ERNST & YOUNG LLP, INDEPENDENT AUDITORS We consent to the incorporation by reference in the Registration Statement (Form S-8 No. 33-9931) pertaining to the Sunoco, Inc. Capital Accumulation Plan of our report dated May 31, 2002 with respect to the financial statements and supplemental schedule of the Sunoco, Inc. Capital Accumulation Plan included in this Annual Report (Form 11-K) for the year ended December 31, 2001. /s/ ERNST & YOUNG LLP - --------------------- Ernst & Young LLP Philadelphia, Pennsylvania June 20, 2002